copy-acl: enhance Solaris ACL error handling
[gnulib.git] / m4 / wchar.m4
index fd8a387..e81485d 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 29
+# wchar.m4 serial 31
 
 AC_DEFUN([gl_WCHAR_H],
 [
@@ -21,12 +21,6 @@ AC_DEFUN([gl_WCHAR_H],
   gl_CHECK_NEXT_HEADERS([wchar.h])
   if test $ac_cv_header_wchar_h = yes; then
     HAVE_WCHAR_H=1
-    AC_CACHE_CHECK([whether <wchar.h> is standalone],
-      [gl_cv_header_wchar_h_standalone],
-      [AC_COMPILE_IFELSE([[#include <wchar.h>
-wchar_t w;]],
-        [gl_cv_header_wchar_h_standalone=yes],
-        [gl_cv_header_wchar_h_standalone=no])])
   else
     HAVE_WCHAR_H=0
   fi
@@ -39,6 +33,19 @@ wchar_t w;]],
     HAVE_WINT_T=0
   fi
   AC_SUBST([HAVE_WINT_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require additional headers.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+# include <stdio.h>
+# include <time.h>
+#endif
+#include <wchar.h>
+    ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
+    wcsrtombs wcsnrtombs wcwidth])
 ])
 
 dnl Check whether <wchar.h> is usable at all.