From 9376b74c42d3d7361330c7a28d4ac65b6ace6cfb Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 15 Sep 1999 22:01:40 +0000 Subject: (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. --- Modules/socketmodule.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 93a3b09..9dfc5d0 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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 #include -/* added 20 Aug 1999 to remove warnings from inet_ntoa call */ +/* Headers needed for inet_ntoa() and inet_addr() */ +#ifdef __BEOS__ +#include +#else #include +#endif #include #else -- cgit v0.12