From c753b7cad5ab21d847f4a2fdae0eae0cec69198a Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 9 Sep 2010 17:05:15 -0600 Subject: [PATCH] strsignal: work around NetBSD bug * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in . * lib/string.in.h (includes): Likewise. * doc/posix-functions/strsignal.texi (strsignal): Document the bug. Reported by Nelson H. F. Beebe. Signed-off-by: Eric Blake --- ChangeLog | 7 +++++++ doc/posix-functions/strsignal.texi | 5 +++++ lib/string.in.h | 6 ++++++ m4/strsignal.m4 | 3 ++- 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 63214dec1..f3313fe79 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-09-09 Eric Blake + strsignal: work around NetBSD bug + * m4/strsignal.m4 (gl_FUNC_STRSIGNAL): Also check in . + * lib/string.in.h (includes): Likewise. + * doc/posix-functions/strsignal.texi (strsignal): Document the + bug. + Reported by Nelson H. F. Beebe. + gnulib-tool: work with NetBSD /bin/sh * gnulib-tool (func_cache_var, func_cache_lookup_module) (func_get_description, func_get_comment, func_get_status) diff --git a/doc/posix-functions/strsignal.texi b/doc/posix-functions/strsignal.texi index 1d48543fc..51b1d00fd 100644 --- a/doc/posix-functions/strsignal.texi +++ b/doc/posix-functions/strsignal.texi @@ -16,6 +16,11 @@ AIX 4.3.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, mingw. This function does not return a string for out-of-range numbers on some platforms: Solaris, AIX 5.1. + +@item +This function is declared in @code{unistd.h} instead of +@code{string.h} on some platforms: +NetBSD 5.0. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/string.in.h b/lib/string.in.h index db4c4aa64..5409f31ab 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -49,6 +49,12 @@ # define _GL_ATTRIBUTE_PURE /* empty */ #endif +/* NetBSD 5.0 declares strsignal in , not in . */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_STRSIGNAL@ || defined GNULIB_POSIXCHECK) \ + && ! defined __GLIBC__ +# include +#endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ diff --git a/m4/strsignal.m4 b/m4/strsignal.m4 index be3c73392..6cb8d9d5f 100644 --- a/m4/strsignal.m4 +++ b/m4/strsignal.m4 @@ -1,4 +1,4 @@ -# strsignal.m4 serial 3 +# strsignal.m4 serial 4 dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,6 +26,7 @@ AC_DEFUN([gl_FUNC_STRSIGNAL], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[#include +#include /* NetBSD 5.0 declares it in wrong header. */ ]], [[char *s = strsignal (-1); return !(s != (char *) 0 && s != (char *) -1);]])], -- 2.11.0