]> granicus.if.org Git - php/commitdiff
MFH: configure check for getaddrinfo (Bug #30057)
authorWez Furlong <wez@php.net>
Sun, 26 Sep 2004 01:13:43 +0000 (01:13 +0000)
committerWez Furlong <wez@php.net>
Sun, 26 Sep 2004 01:13:43 +0000 (01:13 +0000)
configure.in

index 22b955278d56e210eadee13a6c79128325b0fa25..c13c449563faf18ae03e3adddaf6f6fccfbd39a7 100644 (file)
@@ -545,17 +545,20 @@ AC_CACHE_CHECK([for getaddrinfo], ac_cv_func_getaddrinfo,
   AC_TRY_RUN([
 #include <netdb.h>
 #include <sys/types.h>
+#ifndef AF_INET
+# include <sys/socket.h>
+#endif
 int main(void) {
   struct addrinfo *ai, *pai, hints;
 
   memset(&hints, 0, sizeof(hints));
   hints.ai_flags = AI_NUMERICHOST;
 
-  if (getaddrinfo("127.0.0.1", NULL, &hints, &ai) < 0) {
+  if (getaddrinfo("127.0.0.1", 0, &hints, &ai) < 0) {
     exit(1);
   }
 
-  if (ai == NULL) {
+  if (ai == 0) {
     exit(1);
   }