[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
<netdb.h> on Haiku
From: |
Bruno Haible |
Subject: |
<netdb.h> on Haiku |
Date: |
Sat, 15 Nov 2008 13:22:40 +0100 |
User-agent: |
KMail/1.5.4 |
Hi Simon,
I'm seeing these compilation errors on Haiku:
/data/testdir1/gllib/getaddrinfo.c: In function `getaddrinfo':
/data/testdir1/gllib/getaddrinfo.c:183: `AI_NUMERICSERV' undeclared (first use
in this function)
/data/testdir1/gllib/getaddrinfo.c:183: (Each undeclared identifier is reported
only once
/data/testdir1/gllib/getaddrinfo.c:183: for each function it appears in.)
/data/testdir1/gllib/getaddrinfo.c: In function `getnameinfo':
/data/testdir1/gllib/getaddrinfo.c:429: `EAI_OVERFLOW' undeclared (first use in
this function)
make[4]: *** [getaddrinfo.o] Error 1
Haiku has <netdb.h> and it has most of the definitions, but EAI_OVERFLOW
and AI_NUMERICSERV are not defined.
OK to commit this workaround?
2008-11-15 Bruno Haible <address@hidden>
* lib/netdb.in.h: Activate the definitions also when the system's
<netdb.h> has 'struct addrinfo'.
* m4/netdb_h.m4 (gl_HEADER_NETDB): Replace netdb.h also when it lacks
EAI_OVERFLOW or AI_NUMERICSERV.
* doc/posix-headers/netdb.texi: Document the problem.
--- doc/posix-headers/netdb.texi.orig 2008-11-15 13:16:56.000000000 +0100
+++ doc/posix-headers/netdb.texi 2008-11-15 13:16:13.000000000 +0100
@@ -13,7 +13,7 @@
@item
This header file is incomplete on some platforms:
-Cygwin 1.5.x
+Cygwin 1.5.x, Haiku.
@end itemize
Portability problems not fixed by Gnulib:
--- lib/netdb.in.h.orig 2008-11-15 13:16:56.000000000 +0100
+++ lib/netdb.in.h 2008-11-11 01:39:47.000000000 +0100
@@ -36,12 +36,6 @@
#ifndef _GL_NETDB_H
#define _GL_NETDB_H
-#if @HAVE_NETDB_H@ && @HAVE_STRUCT_ADDRINFO@
-
-/* Declarations for a platform that has <netdb.h>. */
-
-#else
-
/* Get netdb.h definitions such as struct hostent for MinGW. */
#include <sys/socket.h>
@@ -112,7 +106,7 @@
# endif
# ifndef EAI_OVERFLOW
-/* Not defined on mingw32. */
+/* Not defined on mingw32 and Haiku. */
# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
# endif
# ifndef EAI_ADDRFAMILY
@@ -184,7 +178,5 @@
#endif /* @GNULIB_GETADDRINFO@ */
-#endif /* HAVE_NETDB_H */
-
#endif /* _GL_NETDB_H */
#endif /* _GL_NETDB_H */
--- m4/netdb_h.m4.orig 2008-11-15 13:16:56.000000000 +0100
+++ m4/netdb_h.m4 2008-11-15 13:12:43.000000000 +0100
@@ -1,4 +1,4 @@
-# netdb_h.m4 serial 4
+# netdb_h.m4 serial 5
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,8 +9,14 @@
AC_REQUIRE([gl_NETDB_H_DEFAULTS])
gl_CHECK_NEXT_HEADERS([netdb.h])
if test $ac_cv_header_netdb_h = yes; then
- AC_CHECK_TYPES([struct addrinfo], [NETDB_H=''], [NETDB_H='netdb.h'],
- [[#include <netdb.h>]])
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <netdb.h>
+ struct addrinfo a;
+ int b = EAI_OVERFLOW;
+ int c = AI_NUMERICSERV;
+ ]])],
+ [NETDB_H=''], [NETDB_H='netdb.h'])
HAVE_NETDB_H=1
else
NETDB_H='netdb.h'
- <netdb.h> on Haiku,
Bruno Haible <=