--- doc/posix-headers/locale.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/locale.texi 2009-08-13 10:52:43.000000000 +0200 @@ -12,7 +12,7 @@ mingw. @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/stddef.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/stddef.texi 2009-08-13 10:52:42.000000000 +0200 @@ -11,7 +11,7 @@ Some old platforms fail to provide @code{wchar_t}. @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/stdio.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/stdio.texi 2009-08-13 10:52:42.000000000 +0200 @@ -8,7 +8,7 @@ Portability problems fixed by Gnulib: @itemize @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/stdlib.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/stdlib.texi 2009-08-13 10:52:43.000000000 +0200 @@ -14,7 +14,7 @@ The macro @code{EXIT_FAILURE} is incorrectly defined on Tandem/NSK. @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/string.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/string.texi 2009-08-13 10:52:43.000000000 +0200 @@ -8,7 +8,7 @@ Portability problems fixed by Gnulib: @itemize @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/unistd.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/unistd.texi 2009-08-13 10:52:43.000000000 +0200 @@ -20,7 +20,7 @@ mingw. @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- doc/posix-headers/wchar.texi.orig 2009-08-13 11:38:25.000000000 +0200 +++ doc/posix-headers/wchar.texi 2009-08-13 10:52:43.000000000 +0200 @@ -18,7 +18,7 @@ IRIX 5.3. @item -Some platforms provide @code{NULL} that cannot be used in arbitrary +Some platforms provide a @code{NULL} macro that cannot be used in arbitrary expressions: NetBSD 5.0 @end itemize --- lib/stddef.in.h.orig 2009-08-13 11:38:25.000000000 +0200 +++ lib/stddef.in.h 2009-08-13 11:36:41.000000000 +0200 @@ -60,7 +60,20 @@ /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ #if @REPLACE_NULL@ # undef NULL -# define NULL ((void *) 0) +# ifdef __cplusplus + /* ISO C++ says that the macro NULL must expand to an integer constant + expression, hence '((void *) 0)' is not allowed in C++. */ +# if __GNUG__ >= 3 + /* GNU C++ has a __null macro that behaves like an integer ('int' or + 'long') but has the same size as a pointer. Use that, to avoid + warnings. */ +# define NULL __null +# else +# define NULL 0L +# endif +# else +# define NULL ((void *) 0) +# endif #endif /* Some platforms lack wchar_t. */ --- lib/unistd.in.h.orig 2009-08-13 11:38:25.000000000 +0200 +++ lib/unistd.in.h 2009-08-13 10:53:28.000000000 +0200 @@ -29,7 +29,7 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* NetBSD 5.0 mis-defines NULL. */ +/* NetBSD 5.0 mis-defines NULL. Also get size_t. */ #include /* mingw doesn't define the SEEK_* or *_FILENO macros in . */ --- m4/locale_h.m4.orig 2009-08-13 11:38:25.000000000 +0200 +++ m4/locale_h.m4 2009-08-13 10:55:25.000000000 +0200 @@ -12,17 +12,15 @@ 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 - LOCALE_H= - else - LOCALE_H=locale.h - fi - AC_SUBST([LOCALE_H]) - gl_CHECK_NEXT_HEADERS([locale.h]) dnl If is replaced, then must also be replaced. AC_REQUIRE([gl_STDDEF_H]) - if test -n "$STDDEF_H"; then + + if test $gl_cv_header_working_locale_h = yes && test -z "$STDDEF_H"; then + LOCALE_H= + else + gl_CHECK_NEXT_HEADERS([locale.h]) LOCALE_H=locale.h fi + AC_SUBST([LOCALE_H]) ]) --- m4/stddef_h.m4.orig 2009-08-13 11:38:25.000000000 +0200 +++ m4/stddef_h.m4 2009-08-13 11:01:22.000000000 +0200 @@ -9,7 +9,6 @@ [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) - gl_CHECK_NEXT_HEADERS([stddef.h]) if test $gt_cv_c_wchar_t = no; then HAVE_WCHAR_T=0 STDDEF_H=stddef.h @@ -17,7 +16,7 @@ AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], [gl_cv_decl_null_works], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include - int test[sizeof NULL == sizeof (void *) ? 1 : -1]; + int test[2 * (sizeof NULL == sizeof (void *)) -1]; ]])], [gl_cv_decl_null_works=yes], [gl_cv_decl_null_works=no])]) @@ -25,6 +24,9 @@ REPLACE_NULL=1 STDDEF_H=stddef.h fi + if test -n "$STDDEF_H"; then + gl_CHECK_NEXT_HEADERS([stddef.h]) + fi ]) AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], --- m4/wchar.m4.orig 2009-08-13 11:38:25.000000000 +0200 +++ m4/wchar.m4 2009-08-13 11:06:19.000000000 +0200 @@ -27,7 +27,10 @@ fi AC_SUBST([HAVE_WINT_T]) - if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then + dnl If is replaced, then must also be replaced. + AC_REQUIRE([gl_STDDEF_H]) + + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes || test -n "$STDDEF_H"; then WCHAR_H=wchar.h fi @@ -42,12 +45,8 @@ HAVE_WCHAR_H=0 fi AC_SUBST([HAVE_WCHAR_H]) - gl_CHECK_NEXT_HEADERS([wchar.h]) - - dnl If is replaced, then must also be replaced. - AC_REQUIRE([gl_STDDEF_H]) - if test -n "$STDDEF_H"; then - WCHAR_H=wchar.h + if test -n "$WCHAR_H"; then + gl_CHECK_NEXT_HEADERS([wchar.h]) fi ])