Skip to content

Commit

Permalink
Fix Socket.cpp compile in mingw. Reference #569
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Feb 24, 2017
1 parent 8a7f17a commit c95cbaf
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/hx/libs/std/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@
#include <string.h>



#ifdef NEKO_WINDOWS
# include <winsock2.h>
# include <In6addr.h>
# include <Ws2tcpip.h>

#ifdef __GNUC__
// Mingw / gcc on windows
#define _WIN32_WINNT 0x0501
#include <winsock2.h>
# include <Ws2tcpip.h>

extern "C" {
WINSOCK_API_LINKAGE INT WSAAPI inet_pton( INT Family, PCSTR pszAddrString, PVOID pAddrBuf);
WINSOCK_API_LINKAGE PCSTR WSAAPI inet_ntop(INT Family, PVOID pAddr, PSTR pStringBuf, size_t StringBufSize);
}

#else
// Windows...
#include <winsock2.h>
#include <In6addr.h>
#include <Ws2tcpip.h>
#endif

# define FDSIZE(n) (sizeof(u_int) + (n) * sizeof(SOCKET))
# define SHUT_WR SD_SEND
# define SHUT_RD SD_RECEIVE
Expand Down Expand Up @@ -41,6 +56,8 @@ typedef socklen_t SocketLen;
# define MSG_NOSIGNAL 0
#endif



namespace
{

Expand Down

0 comments on commit c95cbaf

Please sign in to comment.