Merge pull request #37 from linusyang/win32-fix

Fix latest 1.4.2 build for win32 (MinGW)
This commit is contained in:
Max Lv
2014-01-11 16:14:25 -08:00
4 changed files with 13 additions and 3 deletions
+4
View File
@@ -7,6 +7,10 @@
#include <stdlib.h>
#include "cache.h"
#ifdef __MINGW32__
#include "win32.h"
#endif
/** Creates a new cache object
@param dst
+1 -1
View File
@@ -8,6 +8,6 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE
asyncns_t *asyncns,
#endif
int method, int timeout, const char *interface);
int method, int timeout, const char *iface);
#endif // _INCLUDE_H
+2 -2
View File
@@ -754,7 +754,7 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE
asyncns_t *asyncns,
#endif
int method, int timeout, const char *interface)
int method, int timeout, const char *iface)
{
// Inilitialize ev loop
@@ -778,7 +778,7 @@ int udprelay_init(const char *server_host, const char *server_port,
struct server_ctx *server_ctx = new_server_ctx(serverfd);
server_ctx->timeout = timeout;
server_ctx->method = method;
server_ctx->iface = interface;
server_ctx->iface = iface;
server_ctx->conn_cache = conn_cache;
#ifdef UDPRELAY_LOCAL
server_ctx->remote_host = remote_host;
+6
View File
@@ -1,6 +1,10 @@
#ifndef _WIN32_H
#define _WIN32_H
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501
#include <winsock2.h>
@@ -29,5 +33,7 @@ void winsock_init(void);
void winsock_cleanup(void);
void ss_error(const char *s);
size_t strnlen(const char *s, size_t maxlen);
int setnonblocking(int fd);
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
#endif