dnl Written by Eric Blake.
-# wchar.m4 serial 29
+# wchar.m4 serial 31
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
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.