Module: ngircd.git Branch: master Commit: 13d9e0c5a7e03559a2b5bf405b526098b15bd0e6 URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=13d9e...
Author: Alexander Barton alex@barton.de Date: Sun Nov 6 14:16:59 2011 +0100
Test for gai_strerror()
If gai_strerror() isn't available, use a macro that simply returns a static error message (regardless of the real error code).
For example, GNU libc 2.0.7 doesn't implement gai_strerror().
---
configure.in | 8 +++++--- src/portab/portab.h | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/configure.in b/configure.in index e48e9e3..92434ec 100644 --- a/configure.in +++ b/configure.in @@ -160,10 +160,12 @@ AC_FUNC_STRFTIME
AC_CHECK_FUNCS([ \ bind gethostbyaddr gethostbyname gethostname inet_ntoa \ - setsid setsockopt socket strcasecmp waitpid],,AC_MSG_ERROR([required function missing!])) + setsid setsockopt socket strcasecmp waitpid],, + AC_MSG_ERROR([required function missing!]))
-AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_aton sigaction sigprocmask snprintf \ - vsnprintf strdup strlcpy strlcat strtok_r) +AC_CHECK_FUNCS([ \ + gai_strerror getaddrinfo getnameinfo inet_aton sigaction \ + sigprocmask snprintf vsnprintf strdup strlcpy strlcat strtok_r])
# -- Configuration options --
diff --git a/src/portab/portab.h b/src/portab/portab.h index a75aa34..90f36a0 100644 --- a/src/portab/portab.h +++ b/src/portab/portab.h @@ -164,6 +164,10 @@ extern char * strtok_r PARAMS((char *str, const char *delim, char **saveptr)); extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list args )); #endif
+#ifndef HAVE_GAI_STRERROR +#define gai_strerror(r) "unknown error" +#endif + #ifndef PACKAGE_NAME #define PACKAGE_NAME PACKAGE #endif
ngircd-commits@lists.barton.de