AC_REPLACE_FUNCS([getaddrinfo]) in 8.1.3

From: Albert Chin <pgsql-hackers(at)mlists(dot)thewrittenword(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: AC_REPLACE_FUNCS([getaddrinfo]) in 8.1.3
Date: 2006-02-19 23:43:37
Message-ID: 20060219234336.GD93931@mail1.thewrittenword.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

AC_REPLACE_FUNCS([getaddrinfo]) won't correctly detect getaddrinfo on
Tru64 UNIX because the function doesn't exist under that name in libc.
>From <netdb.h>:
#if defined (_SOCKADDR_LEN) || defined (_XOPEN_SOURCE_EXTENDED)
#define getaddrinfo ngetaddrinfo
#else
#define getaddrinfo ogetaddrinfo
#endif

The original code in 8.1.1 was:
AC_MSG_CHECKING([for getaddrinfo by including <netdb.h>])
AC_TRY_LINK([#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>],
[getaddrinfo(NULL, NULL, NULL, NULL);],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_GETADDRINFO, 1,
[Define to 1 if you have the `getaddrinfo' function.])],
[AC_MSG_RESULT([no])
AC_LIBOBJ(getaddrinfo)])

So, what's the best way to merge the two? If getaddrinfo() is borked
on Windows, how about AC_TRY_RUN to test it out?

--
albert chin (china(at)thewrittenword(dot)com)

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Satoshi Nagayasu 2006-02-19 23:49:43 Re: Prepared Xacts and Vacuum question
Previous Message Douglas McNaught 2006-02-19 23:28:17 Re: postgresql query string length limit