diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-03-01 08:31:07 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-03-01 08:31:07 +0000 |
commit | 272cb40e31fd2eb194509bcc028998d324ba42c2 (patch) | |
tree | d5ac74392f35109c121c5f6d18fe8df687e80e39 | |
parent | 31e233aa7a02ed8e95227527223db947567830b4 (diff) | |
download | cpython-git-272cb40e31fd2eb194509bcc028998d324ba42c2.tar.gz |
Patch #520062: Support IPv6 with VC.NET.
-rw-r--r-- | Modules/socketmodule.c | 3 | ||||
-rw-r--r-- | Modules/socketmodule.h | 10 | ||||
-rw-r--r-- | PC/pyconfig.h | 4 |
3 files changed, 17 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 2f954a9ce3..92b8d4bbc6 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -409,8 +409,11 @@ PyGAI_Err(int error) { PyObject *v; +#ifdef EAI_SYSTEM + /* EAI_SYSTEM is not available on Windows XP. */ if (error == EAI_SYSTEM) return PySocket_Err(); +#endif #ifdef HAVE_GAI_STRERROR v = Py_BuildValue("(is)", error, gai_strerror(error)); diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index d1503ba1b4..a59e6f750c 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -9,8 +9,18 @@ # endif #else /* MS_WINDOWS */ +#if _MSC_VER >= 1300 +# include <winsock2.h> +# include <ws2tcpip.h> +# define HAVE_ADDRINFO +# define HAVE_SOCKADDR_STORAGE +# define HAVE_GETADDRINFO +# define HAVE_GETNAMEINFO +# define ENABLE_IPV6 +#else # include <winsock.h> #endif +#endif #ifdef HAVE_SYS_UN_H # include <sys/un.h> diff --git a/PC/pyconfig.h b/PC/pyconfig.h index 6402f1d7b0..b412f7780b 100644 --- a/PC/pyconfig.h +++ b/PC/pyconfig.h @@ -408,7 +408,11 @@ typedef int pid_t; /* #undef size_t */ /* Define to `int' if <sys/types.h> doesn't define. */ +#if _MSC_VER + 0 >= 1300 +/* VC.NET typedefs socklen_t in ws2tcpip.h. */ +#else #define socklen_t int +#endif /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 |