add define for windows mutex

github/master
giv 2014-05-19 20:40:35 +00:00
parent 165b2cf2e5
commit e2b1069a5f
2 changed files with 26 additions and 9 deletions

View File

@ -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

View File

@ -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_;