From: Martin v. Löwis Date: Thu, 30 Dec 2004 13:52:17 +0000 (+0000) Subject: Patch 728330: Fix compilation problems on IRIX. X-Git-Tag: v2.3.5c1~49 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=85e6c71d1d993bf2c0df3566517ac93d9fe506cc;p=thirdparty%2FPython%2Fcpython.git Patch 728330: Fix compilation problems on IRIX. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index edf587a70de4..b28496dc24db 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -192,8 +192,18 @@ shutdown(how) -- shut down traffic in one or both directions\n\ /* XXX Using _SGIAPI is the wrong thing, but I don't know what the right thing is. */ +#undef _SGIAPI /* to avoid warning */ #define _SGIAPI 1 +#undef _XOPEN_SOURCE +#include +#include +#include +#ifdef _SS_ALIGNSIZE +#define HAVE_GETADDRINFO 1 +#define HAVE_GETNAMEINFO 1 +#endif + #define HAVE_INET_PTON #include #endif @@ -259,7 +269,19 @@ int h_errno; /* not used */ # define O_NONBLOCK O_NDELAY #endif -#include "addrinfo.h" +/* include Python's addrinfo.h unless it causes trouble */ +#if defined(__sgi) && _COMPILER_VERSION>700 && defined(_SS_ALIGNSIZE) + /* Do not include addinfo.h on some newer IRIX versions. + * __SS_ALIGNSIZE is defined in sys/socket.h by 6.5.21, + * for example, but not by 6.5.10. + */ +#elif defined(_MSC_VER) && _MSC_VER>1200 + /* Do not include addrinfo.h for MSVC7 or greater. + * addrinfo and EAI_* constants are defined in ws2tcpip.h + */ +#else +# include "addrinfo.h" +#endif #ifndef HAVE_INET_PTON int inet_pton(int af, const char *src, void *dst);