[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replacement getaddrinfo not working properly
From: |
Aharon Robbins |
Subject: |
Re: replacement getaddrinfo not working properly |
Date: |
Thu, 05 Apr 2007 16:37:00 +0300 |
Hi. Thanks for tracking this down. I will look into modifying things along
the lines you suggest.
Arnold
In article <address@hidden> you write:
>Hi,
>
>It seems that adding AC_USE_SYSTEM_EXTENSIONS to configure.ac
>will always cause _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE to
>be defined (at least that is the case for autoconf version 2.61 on my
>linux FC6 host). From /usr/share/autoconf/autoconf/specific.m4:
>
> # AC_USE_SYSTEM_EXTENSIONS
> # ------------------------
> # Enable extensions on systems that normally disable them,
> # typically due to standards-conformance issues.
> AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
> [
> AC_BEFORE([$0], [AC_COMPILE_IFELSE])
> AC_BEFORE([$0], [AC_RUN_IFELSE])
>
> AC_REQUIRE([AC_GNU_SOURCE])
> AC_REQUIRE([AC_AIX])
> AC_REQUIRE([AC_MINIX])
>
> AH_VERBATIM([__EXTENSIONS__],
> [/* Enable extensions on Solaris. */
> #ifndef __EXTENSIONS__
> # undef __EXTENSIONS__
> #endif
> #ifndef _POSIX_PTHREAD_SEMANTICS
> # undef _POSIX_PTHREAD_SEMANTICS
> #endif
> #ifndef _TANDEM_SOURCE
> # undef _TANDEM_SOURCE
> #endif])
> AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
> [ac_cv_safe_to_define___extensions__],
> [AC_COMPILE_IFELSE(
> [AC_LANG_PROGRAM([
> # define __EXTENSIONS__ 1
> AC_INCLUDES_DEFAULT])],
> [ac_cv_safe_to_define___extensions__=yes],
> [ac_cv_safe_to_define___extensions__=no])])
> test $ac_cv_safe_to_define___extensions__ = yes &&
> AC_DEFINE([__EXTENSIONS__])
> AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
> AC_DEFINE([_TANDEM_SOURCE])
> ])
>
>As you can see, this defines _POSIX_PTHREAD_SEMANTICS and _TANDEM_SOURCE
>unconditionally.
>
>As a result, this logic in io.c to decide whether to include
>missing_d/getaddrinfo.h is not working as intended:
>
> #ifdef _TANDEM_SOURCE
> #include <arpa/inet.h>
> #include <netdb.h>
> #else
> #ifdef HAVE_GETADDRINFO
> #include <netdb.h>
> #else
> #include "missing_d/getaddrinfo.h"
> #endif
> #endif
>
>Because _TANDEM_SOURCE is defined, there is never any chance
>of including missing_d/getaddrinfo.h.
>
>This causes compilation errors on systems that do not supply getaddrinfo.
>
>I'm not certain of the best fix. Why is it necessary to test
>for _TANDEM_SOURCE at all in this spot? It seems that the only
>difference is whether to include <arpa/inet.h>. Couldn't configure.ac
>just test whether this header file exists (and similarly for netdb.h),
>and just include them unconditionally if they exist (without caring
>about _TANDEM_SOURCE)?
>
>Regards,
>Andy
>
>
--
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd. arnold AT skeeve DOT com
P.O. Box 354 Home Phone: +972 8 979-0381 Fax: +1 206 350 8765
Nof Ayalon Cell Phone: +972 50 729-7545
D.N. Shimshon 99785 ISRAEL