diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-06-13 00:42:22 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-06-13 00:42:22 (GMT) |
commit | a4dd2e20e2302cc41a027cae5d0057dc2dff2ba6 (patch) | |
tree | c70e9c1bfc706b80cdd7e9343a13e41136ac99ef /Modules/socketmodule.h | |
parent | 114f7e5ffff86daef0a9e9802317e7b259c447f9 (diff) | |
download | cpython-a4dd2e20e2302cc41a027cae5d0057dc2dff2ba6.zip cpython-a4dd2e20e2302cc41a027cae5d0057dc2dff2ba6.tar.gz cpython-a4dd2e20e2302cc41a027cae5d0057dc2dff2ba6.tar.bz2 |
Restore support for Microsoft VC6 compiler.
Some functions in the msvcrt module are skipped,
and socket.ioctl is enabled only when using a more recent Platform SDK.
(and yes, there are still companies that use a 10-years old compiler)
Diffstat (limited to 'Modules/socketmodule.h')
-rw-r--r-- | Modules/socketmodule.h | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h index 285c1fe..44483cb 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -13,19 +13,23 @@ # endif #else /* MS_WINDOWS */ -#if _MSC_VER >= 1300 # include <winsock2.h> # include <ws2tcpip.h> -# include <MSTcpIP.h> /* for SIO_RCVALL */ -# define HAVE_ADDRINFO -# define HAVE_SOCKADDR_STORAGE -# define HAVE_GETADDRINFO -# define HAVE_GETNAMEINFO -# define ENABLE_IPV6 -#else -# include <winsock.h> -#endif -#endif +/* VC6 is shipped with old platform headers, and does not have MSTcpIP.h + * Separate SDKs have all the functions we want, but older ones don't have + * any version information. I use IPPROTO_IPV6 to detect a decent SDK. + */ +# ifdef IPPROTO_IPV6 +# include <MSTcpIP.h> /* for SIO_RCVALL */ +# define HAVE_ADDRINFO +# define HAVE_SOCKADDR_STORAGE +# define HAVE_GETADDRINFO +# define HAVE_GETNAMEINFO +# define ENABLE_IPV6 +# else +typedef int socklen_t; +# endif /* IPPROTO_IPV6 */ +#endif /* MS_WINDOWS */ #ifdef HAVE_SYS_UN_H # include <sys/un.h> |