diff options
author | Bruno Haible <bruno@clisp.org> | 2020-01-01 17:01:54 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-01-01 17:01:54 +0100 |
commit | 86e05effe83d629bfcb4d798c4951781387a1bfa (patch) | |
tree | d6773c9eeaa2d2e640c3750c4cd997e5e399c19b /m4/uchar.m4 | |
parent | d325c7f69574f24587a6673fb11164d84bef89fa (diff) | |
download | gnulib-86e05effe83d629bfcb4d798c4951781387a1bfa.tar.gz |
c32tob: New module.
* lib/uchar.in.h (_GL_LARGE_CHAR32_T): New macro.
(c32tob): New declaration.
* lib/c32tob.c: New file.
* m4/uchar.m4 (gl_UCHAR_MODULE_INDICATOR, gl_UCHAR_H_DEFAULTS): New
macros.
(gl_UCHAR_H): Require gl_UCHAR_H_DEFAULTS.
* modules/uchar (Depends-on): Add snippet/c++defs.
(Makefile.am): Include c++defs.h and substitute GNULIB_C32TOB in
uchar.h.
* modules/c32tob: New file.
* tests/test-uchar.c: Verify that _GL_LARGE_CHAR32_T is correctly
defined.
* tests/test-uchar-c++.cc: Include signature.h. Test the signature of
c32tob.
* modules/uchar-c++-tests (Files): Add tests/signature.h.
* doc/posix-functions/wctob.texi: Mention the new module.
Diffstat (limited to 'm4/uchar.m4')
-rw-r--r-- | m4/uchar.m4 | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/m4/uchar.m4 b/m4/uchar.m4 index 69a049c75a..c5a3594ecd 100644 --- a/m4/uchar.m4 +++ b/m4/uchar.m4 @@ -1,4 +1,4 @@ -# uchar.m4 serial 1 +# uchar.m4 serial 2 dnl Copyright (C) 2019-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,8 @@ dnl Prepare the overridden <uchar.h>. AC_DEFUN_ONCE([gl_UCHAR_H], [ + AC_REQUIRE([gl_UCHAR_H_DEFAULTS]) + gl_CHECK_NEXT_HEADERS([uchar.h]) if test $ac_cv_header_uchar_h = yes; then HAVE_UCHAR_H=1 @@ -17,3 +19,17 @@ AC_DEFUN_ONCE([gl_UCHAR_H], fi AC_SUBST([HAVE_UCHAR_H]) ]) + +AC_DEFUN([gl_UCHAR_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_UCHAR_H_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]) +]) + +AC_DEFUN([gl_UCHAR_H_DEFAULTS], +[ + GNULIB_C32TOB=0; AC_SUBST([GNULIB_C32TOB]) +]) |