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

@@ -352,8 +352,8 @@ intercept:
$(ZT_INCLUDES) examples/intercept/intercept.cpp -D_GNU_SOURCE \
-shared -o $(BUILD)/intercept.so $< -ldl
simple:
$(CXX) $(CXXFLAGS) $(SANFLAGS) $(LIBZT_INCLUDES) $(LIBZT_DEFS) examples/bindings/cpp/simple_client_server/client.cpp -o $(BUILD)/client -L$(BUILD) -lzt
$(CXX) $(CXXFLAGS) $(SANFLAGS) $(LIBZT_INCLUDES) $(LIBZT_DEFS) examples/bindings/cpp/simple_client_server/server.cpp -o $(BUILD)/server -L$(BUILD) -lzt
$(CXX) $(CXXFLAGS) $(SANFLAGS) $(LIBZT_INCLUDES) $(LIBZT_DEFS) examples/bindings/cpp/simple_client_server/client.cpp -o $(BUILD)/client -L$(BUILD) -lzt $(WINDEFS)
$(CXX) $(CXXFLAGS) $(SANFLAGS) $(LIBZT_INCLUDES) $(LIBZT_DEFS) examples/bindings/cpp/simple_client_server/server.cpp -o $(BUILD)/server -L$(BUILD) -lzt $(WINDEFS)
dlltest:
$(CXX) $(CXXFLAGS)

View File

@@ -1,12 +1,19 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <string.h>
#include <string>
#if defined(__linux__) || defined(__APPLE__)
#include <netinet/in.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <WinSock2.h>
#include <stdint.h>
#endif
#include "libzt.h"

View File

@@ -1,13 +1,20 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <string.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string>
#if defined(__linux__) || defined(__APPLE__)
#include <netinet/in.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <WinSock2.h>
#include <stdint.h>
#endif
#include "libzt.h"
int main(int argc, char **argv)

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)

View File

@@ -41,7 +41,9 @@
#include <sys/socket.h>
#endif
#if defined(__linux__) || defined(__APPLE__)
#include <sys/socket.h>
#endif
#include "SysUtils.h"
#include <stdint.h>

View File

@@ -30,10 +30,13 @@
* Misc utilities
*/
//#include "libztDebug.h"
#include "Utilities.h"
#if defined(__MINGW32__)
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <WinSock2.h>
#include <stdint.h>
#include <string.h>
int inet_pton4(const char *src, void *dst)
{

View File

@@ -49,7 +49,6 @@
#include "libztDebug.h"
#include <string.h>
//void * memcpy(void * dst, const void * src, size_t n);
#ifdef __cplusplus
extern "C" {

View File

@@ -24,20 +24,27 @@
* of your own application.
*/
#include <unistd.h>
#if defined(__linux__) || defined(__APPLE__)
#include <sys/socket.h>
#include <arpa/inet.h>
#include <arpa/inet.h>
#include <string.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <poll.h>
#endif
#if defined(__MINGW32__) || defined(__MINGW64__)
#include <WinSock2.h>
#include <stdint.h>
#endif
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <fcntl.h>
#include <errno.h>
#include <poll.h>
#include <iostream>
#include <vector>
#include <algorithm>