Kaydet (Commit) 1b6e463b authored tarafından Guido van Rossum's avatar Guido van Rossum

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.
üst 29e51844
...@@ -165,8 +165,10 @@ int shutdown( int, int ); ...@@ -165,8 +165,10 @@ int shutdown( int, int );
#ifdef __BEOS__ #ifdef __BEOS__
#include <net/netdb.h> #include <net/netdb.h>
#else #else
#ifndef macintosh
#include <arpa/inet.h> #include <arpa/inet.h>
#endif #endif
#endif
#include <fcntl.h> #include <fcntl.h>
#else #else
...@@ -1829,8 +1831,11 @@ BUILD_FUNC_DEF_2(PySocket_inet_aton, PyObject *, self, PyObject *, args) ...@@ -1829,8 +1831,11 @@ BUILD_FUNC_DEF_2(PySocket_inet_aton, PyObject *, self, PyObject *, args)
if (!PyArg_Parse(args, "s", &ip_addr)) { if (!PyArg_Parse(args, "s", &ip_addr)) {
return NULL; return NULL;
} }
#ifdef macintosh
packed_addr = (long)inet_addr(ip_addr).s_addr;
#else
packed_addr = inet_addr(ip_addr); packed_addr = inet_addr(ip_addr);
#endif
if (packed_addr == INADDR_NONE) { /* invalid address */ if (packed_addr == INADDR_NONE) { /* invalid address */
PyErr_SetString(PySocket_Error, PyErr_SetString(PySocket_Error,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment