Browse Source

win32: suppress compilation errors

pull/37/head
Linus Yang 11 years ago
parent
commit
061430a8ae
4 changed files with 13 additions and 3 deletions
  1. 4
      src/cache.c
  2. 2
      src/include.h
  3. 4
      src/udprelay.c
  4. 6
      src/win32.h

4
src/cache.c

@ -7,6 +7,10 @@
#include <stdlib.h> #include <stdlib.h>
#include "cache.h" #include "cache.h"
#ifdef __MINGW32__
#include "win32.h"
#endif
/** Creates a new cache object /** Creates a new cache object
@param dst @param dst

2
src/include.h

@ -8,6 +8,6 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE #ifdef UDPRELAY_REMOTE
asyncns_t *asyncns, asyncns_t *asyncns,
#endif #endif
int method, int timeout, const char *interface);
int method, int timeout, const char *iface);
#endif // _INCLUDE_H #endif // _INCLUDE_H

4
src/udprelay.c

@ -754,7 +754,7 @@ int udprelay_init(const char *server_host, const char *server_port,
#ifdef UDPRELAY_REMOTE #ifdef UDPRELAY_REMOTE
asyncns_t *asyncns, asyncns_t *asyncns,
#endif #endif
int method, int timeout, const char *interface)
int method, int timeout, const char *iface)
{ {
// Inilitialize ev loop // 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); struct server_ctx *server_ctx = new_server_ctx(serverfd);
server_ctx->timeout = timeout; server_ctx->timeout = timeout;
server_ctx->method = method; server_ctx->method = method;
server_ctx->iface = interface;
server_ctx->iface = iface;
server_ctx->conn_cache = conn_cache; server_ctx->conn_cache = conn_cache;
#ifdef UDPRELAY_LOCAL #ifdef UDPRELAY_LOCAL
server_ctx->remote_host = remote_host; server_ctx->remote_host = remote_host;

6
src/win32.h

@ -1,6 +1,10 @@
#ifndef _WIN32_H #ifndef _WIN32_H
#define _WIN32_H #define _WIN32_H
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0501 #define _WIN32_WINNT 0x0501
#include <winsock2.h> #include <winsock2.h>
@ -29,5 +33,7 @@ void winsock_init(void);
void winsock_cleanup(void); void winsock_cleanup(void);
void ss_error(const char *s); void ss_error(const char *s);
size_t strnlen(const char *s, size_t maxlen); 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 #endif
Loading…
Cancel
Save