diff m4/locale_h.m4 @ 11832:ff3dd373542b

stddef: fix NetBSD 5.0 NULL bug, rather than working around it * tests/test-locale.c: Revert previous patch related to NULL. * tests/test-stdio.c: Likewise. * tests/test-stdlib.c: Likewise. * tests/test-string.c: Likewise. * tests/test-unistd.c: Likewise. * modules/time-tests (Depends-on): Add verify. * modules/wchar-tests (Depends-on): Likewise. * tests/test-time.c: Test for NULL compliance. * tests/test-wchar.c: Likewise. * modules/locale (Depends-on): Add stddef. * modules/stdio (Depends-on): Likewise. * modules/stdlib (Depends-on): Likewise. * modules/string (Depends-on): Likewise. * modules/time (Depends-on): Likewise. * modules/unistd (Depends-on): Likewise. * modules/wchar (Depends-on): Likewise. * lib/locale.in.h (includes): Use <stddef.h> to fix NULL. * lib/stdlib.in.h (includes): Likewise. * lib/string.in.h (includes): Likewise. * lib/time.in.h (includes): Likewise. * lib/unistd.in.h (includes): Likewise. * m4/locale_h.m4 (gl_LOCALE_H): Replace locale.h if stddef.h was replaced. * m4/wchar.m4 (gl_WCHAR_H): Likewise. * m4/stddef_h.m4: New file. * modules/stddef: Likewise. * lib/stddef.in.h: Likewise. * modules/stddef-tests: Likewise. * tests/test-stddef.c: Likewise. * MODULES.html.sh (Basic types <stddef.h>): Mention new module. * doc/posix-headers/stddef.texi (stddef.h): Document the bug. * doc/posix-headers/locale.texi (locale.h): Likewise. * doc/posix-headers/stdio.texi (stdio.h): Likewise. * doc/posix-headers/stdlib.texi (stdlib.h): Likewise. * doc/posix-headers/string.texi (string.h): Likewise. * doc/posix-headers/time.texi (time.h): Likewise. * doc/posix-headers/unistd.texi (unistd.h): Likewise. * doc/posix-headers/wchar.texi (wchar.h): Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
author Eric Blake <ebb9@byu.net>
date Wed, 12 Aug 2009 10:23:03 -0600
parents 442682a45bcd
children 2da64958ab60
line wrap: on
line diff
--- a/m4/locale_h.m4
+++ b/m4/locale_h.m4
@@ -1,5 +1,5 @@
-# locale_h.m4 serial 2
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# locale_h.m4 serial 3
+dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,7 +12,11 @@
 int x = LC_MESSAGES;], [],
        [gl_cv_header_working_locale_h=yes],
        [gl_cv_header_working_locale_h=no])])
-  if test $gl_cv_header_working_locale_h = yes; then
+
+  dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
+  AC_REQUIRE([gl_STDDEF_H])
+
+  if test $gl_cv_header_working_locale_h = yes && test -z "$STDDEF_H"; then
     LOCALE_H=
   else
     gl_CHECK_NEXT_HEADERS([locale.h])