Avoid assigning WCHAR_H in different .m4 files.
authorBruno Haible <bruno@clisp.org>
Sat, 27 Sep 2008 17:13:21 +0000 (19:13 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 27 Sep 2008 17:13:21 +0000 (19:13 +0200)
ChangeLog
m4/wchar.m4
m4/wcwidth.m4

index fe42fd870121a63140c3a27e71bac5fc001ad991..e1ff9b0235e7c0dc219910d8a981fcfe62d86e3e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-09-27  Bruno Haible  <bruno@clisp.org>
+
+       * m4/wchar.m4 (gl_REPLACE_WCHAR_H): New macro.
+       * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Invoke it instead of assigning
+       WCHAR_H directly.
+
 2008-09-27  Bruno Haible  <bruno@clisp.org>
 
        * lib/arpa_inet.in.h: Include the GL_LINK_WARNING anchor.
index c1ed2c6d3907f5e52d4ff46c550ad21ef234a636..5c923fa0e03e32d6d3fe1ac0f3aefb4396c459e8 100644 (file)
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar.m4 serial 5
+# wchar.m4 serial 6
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -45,6 +45,13 @@ wchar_t w;]],
   gl_CHECK_NEXT_HEADERS([wchar.h])
 ])
 
+dnl Unconditionally enables the replacement of <wchar.h>.
+AC_DEFUN([gl_REPLACE_WCHAR_H],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  WCHAR_H=wchar.h
+])
+
 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
 [
   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
@@ -58,6 +65,5 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
   REPLACE_WCWIDTH=0;   AC_SUBST([REPLACE_WCWIDTH])
-  WCHAR_H=
-  AC_SUBST([WCHAR_H])
+  WCHAR_H='';          AC_SUBST([WCHAR_H])
 ])
index 04a9fc270b24a10e2ec77e4d5d63322649c62e8c..4bedefae69a34cb83f474c8fab1c54087b830f42 100644 (file)
@@ -1,5 +1,5 @@
-# wcwidth.m4 serial 13
-dnl Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# wcwidth.m4 serial 14
+dnl Copyright (C) 2006-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,
 dnl with or without modifications, as long as this notice is preserved.
@@ -80,6 +80,6 @@ int main ()
   fi
 
   if test $REPLACE_WCWIDTH = 1 || test $HAVE_DECL_WCWIDTH = 0; then
-    WCHAR_H=wchar.h
+    gl_REPLACE_WCHAR_H
   fi
 ])