(1) On Linux, we really need to trust the configure script to select

the right variant of gethostbyname_r for us, since not all Linuxes are
equal in this respect.  Reported by Laurent Pointal.

(2) On BeOS, Chris Herborth reports that instead of arpa/inet.h you
must include net/netdb.h to get the inet_ntoa() and inet_addr()
prototypes.
This commit is contained in:
Guido van Rossum 1999-09-15 22:01:40 +00:00
parent ba895d892d
commit 9376b74c42
1 changed files with 13 additions and 2 deletions

View File

@ -89,9 +89,16 @@ Socket methods:
#include "Python.h"
/* Hacks for gethostbyname_r(). On some non-Linux platforms, the configure
script doesn't get this right, so we hardcode some platform checks below.
On the other hand, not all Linux versions agree, so there the settings
computed by the configure script are needed! */
#ifndef linux
#undef HAVE_GETHOSTBYNAME_R_3_ARG
#undef HAVE_GETHOSTBYNAME_R_5_ARG
#undef HAVE_GETHOSTBYNAME_R_6_ARG
#endif
#ifndef WITH_THREAD
#undef HAVE_GETHOSTBYNAME_R
@ -103,7 +110,7 @@ Socket methods:
#elif defined(__sun__) || defined(__sgi)
#define HAVE_GETHOSTBYNAME_R_5_ARG
#elif defined(linux)
#define HAVE_GETHOSTBYNAME_R_6_ARG
/* Rely on the configure script */
#else
#undef HAVE_GETHOSTBYNAME_R
#endif
@ -154,8 +161,12 @@ int shutdown( int, int );
#include <sys/socket.h>
#include <netinet/in.h>
/* added 20 Aug 1999 to remove warnings from inet_ntoa call <che@debian.org> */
/* Headers needed for inet_ntoa() and inet_addr() */
#ifdef __BEOS__
#include <net/netdb.h>
#else
#include <arpa/inet.h>
#endif
#include <fcntl.h>
#else