bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

canon-host on cygwin


From: Eric Blake
Subject: canon-host on cygwin
Date: Wed, 22 Oct 2008 05:37:59 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.17) Gecko/20080914 Thunderbird/2.0.0.17 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

For a couple days now, canon-host.c is failing to build on cygwin 1.5.x,
which provides <netdb.h> but lacks struct addrinfo (cygwin didn't add
struct addrinfo/getaddrinfo until 1.7.0).

canon-host.c: In function `canon_host_r':
canon-host.c:64: error: storage size of 'hints' isn't known
canon-host.c:68: error: `AI_CANONNAME' undeclared (first use in this function)
canon-host.c:68: error: (Each undeclared identifier is reported only once
canon-host.c:68: error: for each function it appears in.)
canon-host.c:69: warning: implicit declaration of function `getaddrinfo'
canon-host.c:75: error: dereferencing pointer to incomplete type
canon-host.c:75: error: dereferencing pointer to incomplete type
canon-host.c:77: error: `EAI_MEMORY' undeclared (first use in this function)
canon-host.c:78: warning: implicit declaration of function `freeaddrinfo'
canon-host.c:64: warning: unused variable `hints'
canon-host.c:64: error: storage size of `hints' isn't known
canon-host.c: In function `ch_strerror':
canon-host.c:90: warning: implicit declaration of function `gai_strerror'
canon-host.c:90: warning: return makes pointer from integer without a cast
make[4]: *** [canon-host.o] Error 1

It looks like m4/netdb_h.m4 needs to check for incomplete <netdb.h>, and
also replace the header if struct addrinfo is missing.  I'm committing this:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj/EJcACgkQ84KuGfSFAYD/9ACcDCrGRb0AGeZ1wATTEC5mF5gs
R2EAnRE7QnVMRwk8+C5xd4YJJp2l0vSK
=yDMq
-----END PGP SIGNATURE-----
>From 003690fe71d5ca7beb0af08d252e9f5184f6d245 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 22 Oct 2008 05:34:48 -0600
Subject: [PATCH] netdb: also supply struct addrinfo for cygwin 1.5.x

* m4/netdb_h.m4 (gl_HEADER_NETDB): Check for incomplete header on
older cygwin.
* lib/netdb.in.h [!HAVE_STRUCT_ADDRINFO]: Also supply contents for
cygwin.
* doc/posix-headers/netdb.texi (netdb.h): Document this.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                    |    9 +++++++++
 doc/posix-headers/netdb.texi |    6 +++++-
 lib/netdb.in.h               |    5 +++--
 m4/netdb_h.m4                |    5 +++--
 4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 132cb8a..0fff1d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-10-22  Eric Blake  <address@hidden>
+
+       netdb: also supply struct addrinfo for cygwin 1.5.x
+       * m4/netdb_h.m4 (gl_HEADER_NETDB): Check for incomplete header on
+       older cygwin.
+       * lib/netdb.in.h [!HAVE_STRUCT_ADDRINFO]: Also supply contents for
+       cygwin.
+       * doc/posix-headers/netdb.texi (netdb.h): Document this.
+
 2008-10-21  Bruno Haible  <address@hidden>
 
        Simplification.
diff --git a/doc/posix-headers/netdb.texi b/doc/posix-headers/netdb.texi
index 1654013..caef8e2 100644
--- a/doc/posix-headers/netdb.texi
+++ b/doc/posix-headers/netdb.texi
@@ -3,13 +3,17 @@
 
 POSIX specification: @url{http://www.opengroup.org/susv3xbd/netdb.h.html}
 
-Gnulib module: ---
+Gnulib module: netdb
 
 Portability problems fixed by Gnulib:
 @itemize
 @item
 This header file is missing on some platforms:
 mingw, BeOS.
+
address@hidden
+This header file is incomplete on some platforms:
+Cygwin 1.5.x
 @end itemize
 
 Portability problems not fixed by Gnulib:
diff --git a/lib/netdb.in.h b/lib/netdb.in.h
index 0399646..9c66ae8 100644
--- a/lib/netdb.in.h
+++ b/lib/netdb.in.h
@@ -36,7 +36,7 @@
 #ifndef _GL_NETDB_H
 #define _GL_NETDB_H
 
-#if @HAVE_NETDB_H@
+#if @HAVE_NETDB_H@ && HAVE_STRUCT_ADDRINFO
 
 /* Declarations for a platform that has <netdb.h>.  */
 
@@ -45,7 +45,8 @@
 /* Get netdb.h definitions such as struct hostent for MinGW.  */
 #include <sys/socket.h>
 
-/* Declarations for a platform that lacks <netdb.h>.  */
+/* Declarations for a platform that lacks <netdb.h>, or where it is
+   incomplete.  */
 
 #if @GNULIB_GETADDRINFO@
 
diff --git a/m4/netdb_h.m4 b/m4/netdb_h.m4
index ecb57b4..bbe166f 100644
--- a/m4/netdb_h.m4
+++ b/m4/netdb_h.m4
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 2
+# netdb_h.m4 serial 3
 dnl Copyright (C) 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,8 @@ AC_DEFUN([gl_HEADER_NETDB],
   AC_REQUIRE([gl_NETDB_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([netdb.h])
   if test $ac_cv_header_netdb_h = yes; then
-    NETDB_H=''
+    AC_CHECK_TYPES([struct addrinfo], [NETDB_H=''], [NETDB_H='netdb.h'],
+                   [[#include <netdb.h>]])
     HAVE_NETDB_H=1
   else
     NETDB_H='netdb.h'
-- 
1.6.0.2


reply via email to

[Prev in Thread] Current Thread [Next in Thread]