From 853662a6d1f5ad90e8d73032cea137541f6194e2 Mon Sep 17 00:00:00 2001
From: Gert Doering <gert@greenie.muc.de>
Date: Thu, 24 Nov 2011 19:48:27 +0100
Subject: [PATCH] work around inet_ntop/inet_pton problems for MSVC builds on
WinXP
always use our built-in replacement functions now, even if building
on Win7 (which has inet_ntop/inet_pton in the system libraries) because
the resulting binary will then fail on WinXP.
Signed-off-by: Gert Doering <gert@greenie.muc.de>
---
socket.c | 3 ---
win32.h | 10 ++++++----
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/socket.c b/socket.c
index 5302eca..d91f2dc 100644
a
|
b
|
link_socket_write_udp_posix_sendmsg (struct link_socket *sock, |
3085 | 3085 | * WSAAddressToString() and WSAStringToAddress() functions |
3086 | 3086 | */ |
3087 | 3087 | |
3088 | | #ifndef _MSC_VER |
3089 | 3088 | const char * |
3090 | 3089 | inet_ntop(int af, const void *src, char *dst, socklen_t size) |
3091 | 3090 | { |
… |
… |
inet_pton(int af, const char *src, void *dst) |
3134 | 3133 | return 0; |
3135 | 3134 | } |
3136 | 3135 | |
3137 | | #endif |
3138 | | |
3139 | 3136 | int |
3140 | 3137 | socket_recv_queue (struct link_socket *sock, int maxsize) |
3141 | 3138 | { |
diff --git a/win32.h b/win32.h
index 5b18e3c..0607cad 100644
a
|
b
|
char *get_win_sys_path (void); |
278 | 278 | |
279 | 279 | /* call self in a subprocess */ |
280 | 280 | void fork_to_self (const char *cmdline); |
281 | | #ifndef _MSC_VER |
282 | | const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); |
283 | | int inet_pton(int af, const char *src, void *st); |
284 | | #endif |
| 281 | |
| 282 | const char *openvpn_inet_ntop(int af, const void *src, |
| 283 | char *dst, socklen_t size); |
| 284 | int openvpn_inet_pton(int af, const char *src, void *dst); |
| 285 | #define inet_ntop(af,src,dst,size) openvpn_inet_ntop(af,src,dst,size) |
| 286 | #define inet_pton(af,src,dst) openvpn_inet_pton(af,src,dst) |
285 | 287 | |
286 | 288 | /* Find temporary directory */ |
287 | 289 | const char *win_get_tempdir(); |