summaryrefslogtreecommitdiff
path: root/m4/wctype_h.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/wctype_h.m4')
-rw-r--r--m4/wctype_h.m439
1 files changed, 27 insertions, 12 deletions
diff --git a/m4/wctype_h.m4 b/m4/wctype_h.m4
index 1ab0bc985..7d7421277 100644
--- a/m4/wctype_h.m4
+++ b/m4/wctype_h.m4
@@ -1,4 +1,4 @@
-# wctype_h.m4 serial 26
+# wctype_h.m4 serial 30
dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
@@ -9,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved.
dnl Written by Paul Eggert.
-AC_DEFUN([gl_WCTYPE_H],
+AC_DEFUN_ONCE([gl_WCTYPE_H],
[
AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
AC_REQUIRE([AC_PROG_CC])
@@ -62,7 +62,7 @@ AC_DEFUN([gl_WCTYPE_H],
fi
AC_SUBST([HAVE_WCTYPE_H])
- if test $GNULIB_OVERRIDES_WINT_T = 1; then
+ if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
REPLACE_ISWCNTRL=1
else
case "$gl_cv_func_iswcntrl_works" in
@@ -157,24 +157,39 @@ AC_DEFUN([gl_WCTYPE_H],
])
])
+# gl_WCTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
[
- dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
- AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ dnl Ensure to expand the default settings once only.
+ gl_WCTYPE_H_REQUIRE_DEFAULTS
gl_MODULE_INDICATOR_SET_VARIABLE([$1])
dnl Define it also as a C macro, for the benefit of the unit tests.
gl_MODULE_INDICATOR_FOR_TESTS([$1])
])
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd. It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS],
+[
+ m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS])
+ gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS])
+ ])
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+])
+
AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
[
- GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
- GNULIB_ISWDIGIT=0; AC_SUBST([GNULIB_ISWDIGIT])
- GNULIB_ISWXDIGIT=0; AC_SUBST([GNULIB_ISWXDIGIT])
- GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
- GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE])
- GNULIB_WCTRANS=0; AC_SUBST([GNULIB_WCTRANS])
- GNULIB_TOWCTRANS=0; AC_SUBST([GNULIB_TOWCTRANS])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])