]> granicus.if.org Git - python/commitdiff
Bugfix by Jack Jansen for Macintosh (for the inet_ntoa/aton changes):
authorGuido van Rossum <guido@python.org>
Thu, 4 Nov 1999 18:22:29 +0000 (18:22 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 4 Nov 1999 18:22:29 +0000 (18:22 +0000)
<arpa/inet.h> doesn't exist and isn't needed; and inet_addr() returns
a structure containing a long rather than a long.

Modules/socketmodule.c

index 9dfc5d02fe41863fa252fc62d69f5cefcf1fb711..4f63434bebf2238f4cb20b3f9e15844ac4e7f449 100644 (file)
@@ -165,8 +165,10 @@ int shutdown( int, int );
 #ifdef __BEOS__
 #include <net/netdb.h>
 #else
+#ifndef macintosh
 #include <arpa/inet.h>
 #endif
+#endif
 
 #include <fcntl.h>
 #else
@@ -1829,8 +1831,11 @@ BUILD_FUNC_DEF_2(PySocket_inet_aton, PyObject *, self, PyObject *, args)
        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,