From e0acba6ae2822c92388691043bab62294eda48b4 Mon Sep 17 00:00:00 2001
From: Samuli Seppänen <samuli@openvpn.net>
Date: Fri, 20 May 2011 09:12:45 -0700
Subject: [PATCH] Fixed a number of fatal build errors on Visual Studio 2008
Partially fixes ticket #137
---
helper.c | 12 ++++++------
socket.c | 4 ++++
win/config.h.in | 2 +-
win32.h | 2 ++
4 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/helper.c b/helper.c
index 266b246..c7333f6 100644
a
|
b
|
helper_client_server (struct options *o) |
143 | 143 | #if P2MP |
144 | 144 | #if P2MP_SERVER |
145 | 145 | |
| 146 | /* |
| 147 | * Get tun/tap/null device type |
| 148 | */ |
| 149 | const int dev = dev_type_enum (o->dev, o->dev_type); |
| 150 | const int topology = o->topology; |
| 151 | |
146 | 152 | /* |
147 | 153 | * |
148 | 154 | * HELPER DIRECTIVE for IPv6 |
… |
… |
helper_client_server (struct options *o) |
220 | 226 | * push "route-gateway 10.8.0.1" |
221 | 227 | */ |
222 | 228 | |
223 | | /* |
224 | | * Get tun/tap/null device type |
225 | | */ |
226 | | const int dev = dev_type_enum (o->dev, o->dev_type); |
227 | | const int topology = o->topology; |
228 | | |
229 | 229 | if (o->server_defined) |
230 | 230 | { |
231 | 231 | int netbits = -2; |
diff --git a/socket.c b/socket.c
index 6b855c0..3d4801f 100644
a
|
b
|
link_socket_write_udp_posix_sendmsg (struct link_socket *sock, |
3156 | 3156 | * inet_ntop() and inet_pton() wrap-implementations using |
3157 | 3157 | * WSAAddressToString() and WSAStringToAddress() functions |
3158 | 3158 | */ |
| 3159 | |
| 3160 | /* |
3159 | 3161 | const char * |
3160 | 3162 | inet_ntop(int af, const void *src, char *dst, socklen_t size) |
3161 | 3163 | { |
… |
… |
inet_pton(int af, const char *src, void *dst) |
3204 | 3206 | return 0; |
3205 | 3207 | } |
3206 | 3208 | |
| 3209 | */ |
| 3210 | |
3207 | 3211 | int |
3208 | 3212 | socket_recv_queue (struct link_socket *sock, int maxsize) |
3209 | 3213 | { |
diff --git a/win/config.h.in b/win/config.h.in
index 82344a0..ec447a2 100644
a
|
b
|
typedef unsigned long in_addr_t; |
275 | 275 | #define inline __inline |
276 | 276 | |
277 | 277 | /* type to use in place of socklen_t if not defined */ |
278 | | #define socklen_t unsigned int |
| 278 | /*#define socklen_t unsigned int*/ |
279 | 279 | |
280 | 280 | #ifndef __MINGW32__ |
281 | 281 | /* 32-bit unsigned type */ |
diff --git a/win32.h b/win32.h
index d0ecc85..3b26bb1 100644
a
|
b
|
char *get_win_sys_path (void); |
272 | 272 | |
273 | 273 | /* call self in a subprocess */ |
274 | 274 | void fork_to_self (const char *cmdline); |
| 275 | #ifdef _MSV_VER |
275 | 276 | const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); |
276 | 277 | int inet_pton(int af, const char *src, void *st); |
| 278 | #endif |
277 | 279 | |
278 | 280 | /* Find temporary directory */ |
279 | 281 | const char *win_get_tempdir(); |