]> granicus.if.org Git - python/commitdiff
Fix portability problems with glibc 2.0, as reported in #449157.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 15 Aug 2001 17:14:33 +0000 (17:14 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 15 Aug 2001 17:14:33 +0000 (17:14 +0000)
Modules/_localemodule.c
Modules/addrinfo.h
Modules/getnameinfo.c
Modules/socketmodule.c
configure
configure.in
pyconfig.h.in

index 3f1105446300c050686ffa93a6b6fd37a06381ec..7f7bdd291c060d95c495885c1161df4ff11c14bf 100644 (file)
@@ -527,6 +527,8 @@ init_locale(void)
     ADDINT(ABMON_11);
     ADDINT(ABMON_12);
 
+#ifdef RADIXCHAR
+    /* The following are not available with glibc 2.0 */
     ADDINT(RADIXCHAR);
     ADDINT(THOUSEP);
     /* YESSTR and NOSTR are deprecated in glibc, since they are
@@ -537,6 +539,7 @@ init_locale(void)
     ADDINT(NOSTR);
     */
     ADDINT(CRNCYSTR);
+#endif
 
     ADDINT(D_T_FMT);
     ADDINT(D_FMT);
index 6d0991dee3939f0baee3f5f69ba36712da247f1c..686a4b8b7a1aab710a3e37c2ecf8b83e7b03c926 100644 (file)
 #define        AI_DEFAULT      (AI_V4MAPPED_CFG | AI_ADDRCONFIG)
 #endif
 
+#endif /* HAVE_GETADDRINFO */
+
+#ifndef HAVE_GETNAMEINFO
+
 /*
  * Constants for getnameinfo()
  */
@@ -86,6 +90,8 @@
 #define        NI_DGRAM        0x00000010
 #endif
 
+#endif /* HAVE_GETNAMEINFO */
+
 #ifndef HAVE_ADDRINFO
 struct addrinfo {
        int     ai_flags;       /* AI_PASSIVE, AI_CANONNAME */
@@ -137,4 +143,3 @@ extern void freehostent Py_PROTO((struct hostent *));
 #ifdef __cplusplus
 }
 #endif
-#endif
index 475b531d278c69b2025ed1c39a0034f399e46be1..4827bc6eb27dc9613da1fbe0e0a579e3ad705219 100644 (file)
@@ -81,6 +81,10 @@ struct gni_sockinet {
 #define ENI_FAMILY     5
 #define ENI_SALEN      6
 
+/* forward declaration to make gcc happy */
+int getnameinfo Py_PROTO((const struct sockaddr *, size_t, char *, size_t,
+                         char *, size_t, int));
+
 int
 getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
        const struct sockaddr *sa;
index 16b81ac9a75d10499f3cf1259274cf016d5ced94..525a19e72770e78f2deef1cf10d930ca4ae825d8 100644 (file)
@@ -447,7 +447,11 @@ PyGAI_Err(int error)
        if (error == EAI_SYSTEM)
                return PySocket_Err();
 
+#ifdef HAVE_GAI_STRERROR
        v = Py_BuildValue("(is)", error, gai_strerror(error));
+#else
+       v = Py_BuildValue("(is)", error, "getaddrinfo failed");
+#endif
        if (v != NULL) {
                PyErr_SetObject(PyGAI_Error, v);
                Py_DECREF(v);
index 0d8ef9dbff589c530dd6c2f8c530dece375f6145..0e06ff013ac34402beb2b15f353d62c4bbfc4406 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.245 
+# From configure.in Revision: 1.246 
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13 
@@ -4570,7 +4570,7 @@ echo "$ac_t""MACHDEP_OBJS" 1>&6
 # checks for library functions
 for ac_func in alarm chown clock confstr ctermid ctermid_r execv \
  flock fork fsync fdatasync fpathconf ftime ftruncate \
- getgroups getlogin getpeername getpid getpwent getwd \
+ gai_strerror getgroups getlogin getpeername getpid getpwent getwd \
  hstrerror inet_pton kill link lstat mkfifo mktime mremap \
  nice pathconf pause plock poll pthread_init \
  putenv readlink \
index aa27dd6d576c4991c78ced5d375f1841bba7ec6f..515bc1ea0cf91642b196e0b793e4137981a3a7a0 100644 (file)
@@ -1236,7 +1236,7 @@ AC_MSG_RESULT(MACHDEP_OBJS)
 # checks for library functions
 AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \
  flock fork fsync fdatasync fpathconf ftime ftruncate \
- getgroups getlogin getpeername getpid getpwent getwd \
+ gai_strerror getgroups getlogin getpeername getpid getpwent getwd \
  hstrerror inet_pton kill link lstat mkfifo mktime mremap \
  nice pathconf pause plock poll pthread_init \
  putenv readlink \
index bdb242c4d6e75e29cd0dae86eb4a515dfa6e8058..72fad87c6d3db27e94e71e062f71fe8585ba628e 100644 (file)
 /* Define if you have the ftruncate function.  */
 #undef HAVE_FTRUNCATE
 
+/* Define if you have the gai_strerror function.  */
+#undef HAVE_GAI_STRERROR
+
 /* Define if you have the getaddrinfo function.  */
 #undef HAVE_GETADDRINFO