[Python-checkins] python/dist/src/Modules socketmodule.c, 1.271.6.8, 1.271.6.9

loewis at users.sourceforge.net loewis at users.sourceforge.net
Thu Dec 30 14:52:22 CET 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20773

Modified Files:
      Tag: release23-maint
	socketmodule.c 
Log Message:
Patch 728330: Fix compilation problems on IRIX.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.271.6.8
retrieving revision 1.271.6.9
diff -u -d -r1.271.6.8 -r1.271.6.9
--- socketmodule.c	2 Jun 2004 12:36:49 -0000	1.271.6.8
+++ socketmodule.c	30 Dec 2004 13:52:17 -0000	1.271.6.9
@@ -192,8 +192,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
@@ -259,7 +269,19 @@
 # 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);



More information about the Python-checkins mailing list