diff Modules/socketmodule.c @ 11438:be25aaca11f4 legacy-trunk

Bugfix by Jack Jansen for Macintosh (for the inet_ntoa/aton changes): <arpa/inet.h> doesn't exist and isn't needed; and inet_addr() returns a structure containing a long rather than a long.
author Guido van Rossum <guido@python.org>
date Thu, 04 Nov 1999 18:22:29 +0000
parents adf87d13a0c1
children 28b8585354de
line wrap: on
line diff
--- a/Modules/socketmodule.c	Thu Nov 04 10:30:13 1999 +0000
+++ b/Modules/socketmodule.c	Thu Nov 04 18:22:29 1999 +0000
@@ -165,8 +165,10 @@
 #ifdef __BEOS__
 #include <net/netdb.h>
 #else
+#ifndef macintosh
 #include <arpa/inet.h>
 #endif
+#endif
 
 #include <fcntl.h>
 #else
@@ -1829,8 +1831,11 @@
 	if (!PyArg_Parse(args, "s", &ip_addr)) {
 		return NULL;
 	}
-	
+#ifdef macintosh
+	packed_addr = (long)inet_addr(ip_addr).s_addr;
+#else
 	packed_addr = inet_addr(ip_addr);
+#endif
 
 	if (packed_addr == INADDR_NONE) {	/* invalid address */
 		PyErr_SetString(PySocket_Error,