diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-15 23:37:07 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-15 23:37:07 (GMT) |
commit | b61506989edc59736910434079f9247a0d57e945 (patch) | |
tree | e93bc2656e77483bede1191d0f72787733809465 /Modules | |
parent | 65f9aced6ebecf418a91d273e314e40bd153e113 (diff) | |
download | cpython-b61506989edc59736910434079f9247a0d57e945.zip cpython-b61506989edc59736910434079f9247a0d57e945.tar.gz cpython-b61506989edc59736910434079f9247a0d57e945.tar.bz2 |
Fix for VS 2008
Although WS2_32.dll doesn't have inet_pton the definition conflicts with ws2tcpip.h.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/socketmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 78aeb55..2621a9e 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -285,9 +285,12 @@ typedef size_t socklen_t; #endif #ifndef HAVE_INET_PTON +#if !(defined(_MSC_VER) && _MSC_VER>1499) +/* Don't redefine inet_pton in VS2008 */ int inet_pton(int af, const char *src, void *dst); const char *inet_ntop(int af, const void *src, char *dst, socklen_t size); #endif +#endif #ifdef __APPLE__ /* On OS X, getaddrinfo returns no error indication of lookup @@ -4868,6 +4871,8 @@ init_socket(void) #ifndef HAVE_INET_PTON +#if !(defined(_MSC_VER) && _MSC_VER>1499) +/* Don't redefine inet_pton in VS2008 */ /* Simplistic emulation code for inet_pton that only works for IPv4 */ /* These are not exposed because they do not set errno properly */ @@ -4903,3 +4908,4 @@ inet_ntop(int af, const void *src, char *dst, socklen_t size) } #endif +#endif |