diff Modules/socketmodule.c @ 32149:092ac13a4c40 legacy-trunk

Band-aid type fix for [ 728330 ] Don't define _SGAPI on IRIX The Right Thing would be nice, for now this'll do. At least it isn't going to break anything *other* than IRIX...
author Michael W. Hudson <mwh@python.net>
date Wed, 26 May 2004 17:06:31 +0000
parents ca2fb5cf2fd5
children a799b0d1c568
line wrap: on
line diff
--- a/Modules/socketmodule.c	Wed May 26 13:57:54 2004 +0000
+++ b/Modules/socketmodule.c	Wed May 26 17:06:31 2004 +0000
@@ -61,6 +61,10 @@
 
 */
 
+#if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
+#define _BSD_TYPES
+#endif
+
 #include "Python.h"
 
 #undef MAX
@@ -192,8 +196,18 @@
 
 /* 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 <sys/socket.h>
+#include <sys/types.h>
+#include <netinet/in.h>
+#ifdef _SS_ALIGNSIZE
+#define HAVE_GETADDRINFO 1
+#define HAVE_GETNAMEINFO 1
+#endif
+
 #define HAVE_INET_PTON
 #include <netdb.h>
 #endif
@@ -257,7 +271,12 @@
 # define O_NONBLOCK O_NDELAY
 #endif
 
+#if defined(__sgi) && _COMPILER_VERSION>700 \
+ && !defined(_SS_ALIGNSIZE) /* defined in sys/socket.h            */
+                            /* by some newer versions of IRIX     */
+                            /* (e.g. not by 6.5.10 but by 6.5.21) */
 #include "addrinfo.h"
+#endif
 
 #ifndef HAVE_INET_PTON
 int inet_pton(int af, const char *src, void *dst);