Windows build fixes

This commit is contained in:
Joseph Henry
2017-11-06 16:19:55 -08:00
parent e0d4b84dd4
commit 614432907c
8 changed files with 56 additions and 21 deletions

View File

@@ -34,7 +34,20 @@
#define LIBZT_H
#include "libztDebug.h"
#include "sys/socket.h"
#include <stdlib.h>
#include <unistd.h>
#if defined(__linux__) || defined(__APPLE__)
#include <sys/socket.h>
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <WinSock2.h>
#include <stdint.h>
#include <WS2tcpip.h>
int inet_pton(int af, const char *src, void *dst);
#endif
/****************************************************************************/
/* DLL export for Windows (and other cruft) */
@@ -44,9 +57,6 @@
typedef int ssize_t;
#endif
#include <stdlib.h>
#include <unistd.h>
#if defined(__MING32__) || defined(__MING64__)
#ifdef ADD_EXPORTS
#define ZT_SOCKET_API __declspec(dllexport)