mirror of https://github.com/polistern/i2psam
add define for windows mutex
parent
165b2cf2e5
commit
e2b1069a5f
11
i2psam.cpp
11
i2psam.cpp
|
@ -4,6 +4,17 @@
|
|||
//--------------------------------------------------------------------------------------------------
|
||||
#include "i2psam.h"
|
||||
|
||||
#ifdef WIN32
|
||||
//#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#define FD_SETSIZE
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h> // for sockaddr_in
|
||||
#include <arpa/inet.h> // for ntohs and htons
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <string.h> // for memset
|
||||
|
|
24
i2psam.h
24
i2psam.h
|
@ -12,15 +12,18 @@
|
|||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#ifdef WIN32
|
||||
//#define _WIN32_WINNT 0x0501
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <winsock2.h>
|
||||
#else
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h> // for sockaddr_in
|
||||
#include <arpa/inet.h> // for ntohs and htons
|
||||
#endif
|
||||
//#ifdef WIN32
|
||||
////#define _WIN32_WINNT 0x0501
|
||||
//#define WIN32_LEAN_AND_MEAN 1
|
||||
//#define FD_SETSIZE
|
||||
//#include <winsock2.h>
|
||||
//#else
|
||||
//#include <sys/socket.h>
|
||||
//#include <netinet/in.h> // for sockaddr_in
|
||||
//#include <arpa/inet.h> // for ntohs and htons
|
||||
//#endif
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
// TODO: check a possible bug about cast -1 to SOCKET
|
||||
#define SAM_INVALID_SOCKET (-1)
|
||||
|
@ -233,6 +236,9 @@ public:
|
|||
const sockaddr_in& getAddress() const;
|
||||
|
||||
private:
|
||||
struct SocketImpl;
|
||||
std::auto_ptr<SocketImpl> impl_;
|
||||
|
||||
SOCKET socket_;
|
||||
sockaddr_in servAddr_;
|
||||
std::string SAMHost_;
|
||||
|
|
Loading…
Reference in New Issue