]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
uchar-h: Support multiple gnulib-tool invocations in the same package. master
authorBruno Haible <bruno@clisp.org>
Tue, 28 Apr 2026 15:45:52 +0000 (17:45 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 28 Apr 2026 15:47:20 +0000 (17:47 +0200)
* lib/uchar.in.h (GNULIB_defined_btoc32, GNULIB_defined_c32isalnum,
GNULIB_defined_c32isalpha, GNULIB_defined_c32isblank,
GNULIB_defined_c32iscntrl, GNULIB_defined_c32isdigit,
GNULIB_defined_c32isgraph, GNULIB_defined_c32islower,
GNULIB_defined_c32isprint, GNULIB_defined_c32ispunct,
GNULIB_defined_c32isspace, GNULIB_defined_c32isupper,
GNULIB_defined_c32isxdigit, GNULIB_defined_c32tolower,
GNULIB_defined_c32toupper, GNULIB_defined_c32width,
GNULIB_defined_c32snrtombs, GNULIB_defined_c32srtombs,
GNULIB_defined_c32stombs, GNULIB_defined_c32swidth,
GNULIB_defined_c32tob, GNULIB_defined_mbsnrtoc32s,
GNULIB_defined_mbsrtoc32s, GNULIB_defined_mbstoc32s,
GNULIB_defined_c32_get_type_test, GNULIB_defined_c32_apply_type_test,
GNULIB_defined_c32_get_mapping, GNULIB_defined_c32_apply_mapping): New
macros.

ChangeLog
lib/uchar.in.h

index 32a8a8813676dc531b45ccbd6995c283a7645258..869eb1e1a3cfcca3ac390ddb9f8759b73f48a840 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2026-04-28  Bruno Haible  <bruno@clisp.org>
+
+       uchar-h: Support multiple gnulib-tool invocations in the same package.
+       * lib/uchar.in.h (GNULIB_defined_btoc32, GNULIB_defined_c32isalnum,
+       GNULIB_defined_c32isalpha, GNULIB_defined_c32isblank,
+       GNULIB_defined_c32iscntrl, GNULIB_defined_c32isdigit,
+       GNULIB_defined_c32isgraph, GNULIB_defined_c32islower,
+       GNULIB_defined_c32isprint, GNULIB_defined_c32ispunct,
+       GNULIB_defined_c32isspace, GNULIB_defined_c32isupper,
+       GNULIB_defined_c32isxdigit, GNULIB_defined_c32tolower,
+       GNULIB_defined_c32toupper, GNULIB_defined_c32width,
+       GNULIB_defined_c32snrtombs, GNULIB_defined_c32srtombs,
+       GNULIB_defined_c32stombs, GNULIB_defined_c32swidth,
+       GNULIB_defined_c32tob, GNULIB_defined_mbsnrtoc32s,
+       GNULIB_defined_mbsrtoc32s, GNULIB_defined_mbstoc32s,
+       GNULIB_defined_c32_get_type_test, GNULIB_defined_c32_apply_type_test,
+       GNULIB_defined_c32_get_mapping, GNULIB_defined_c32_apply_mapping): New
+       macros.
+
 2026-04-28  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: pacify gcc -Wint-in-bool-context
index 585dc9809c4469505cf26802bb2bfae1204f5c21..ed1f1a88f30bb4d3b4c139ae7107e2a7827e9ebe 100644 (file)
@@ -188,17 +188,20 @@ typedef uint_least32_t gl_char32_t;
    or to WEOF if C is invalid.  */
 #if @GNULIB_BTOC32@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_BTOC32
+#  if !GNULIB_defined_btoc32
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ATTRIBUTE_PURE wint_t
 btoc32 (int c)
 {
   return
-#  if @GNULIB_BTOWC@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_BTOWC@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          btowc (c);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_btoc32 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (btoc32, wint_t, (int c), _GL_ATTRIBUTE_PURE);
 # endif
@@ -210,6 +213,7 @@ _GL_CXXALIASWARN (btoc32);
 /* Test a specific property of a 32-bit wide character.  */
 #if @GNULIB_C32ISALNUM@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISALNUM
+#  if !GNULIB_defined_c32isalnum
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isalnum (wint_t wc)
@@ -221,6 +225,8 @@ c32isalnum (wint_t wc)
          iswalnum (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isalnum 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isalnum, int, (wint_t wc), );
 # endif
@@ -229,17 +235,20 @@ _GL_CXXALIASWARN (c32isalnum);
 #endif
 #if @GNULIB_C32ISALPHA@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISALPHA
+#  if !GNULIB_defined_c32isalpha
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isalpha (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswalpha (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isalpha 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isalpha, int, (wint_t wc), );
 # endif
@@ -248,17 +257,20 @@ _GL_CXXALIASWARN (c32isalpha);
 #endif
 #if @GNULIB_C32ISBLANK@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISBLANK
+#  if !GNULIB_defined_c32isblank
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isblank (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswblank (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isblank 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isblank, int, (wint_t wc), );
 # endif
@@ -267,17 +279,20 @@ _GL_CXXALIASWARN (c32isblank);
 #endif
 #if @GNULIB_C32ISCNTRL@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISCNTRL
+#  if !GNULIB_defined_c32iscntrl
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32iscntrl (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswcntrl (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32iscntrl 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32iscntrl, int, (wint_t wc), );
 # endif
@@ -286,17 +301,20 @@ _GL_CXXALIASWARN (c32iscntrl);
 #endif
 #if @GNULIB_C32ISDIGIT@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISDIGIT
+#  if !GNULIB_defined_c32isdigit
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isdigit (wint_t wc)
 {
   return
-#  if @GNULIB_ISWDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_ISWDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswdigit (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isdigit 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isdigit, int, (wint_t wc), );
 # endif
@@ -305,17 +323,20 @@ _GL_CXXALIASWARN (c32isdigit);
 #endif
 #if @GNULIB_C32ISGRAPH@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISGRAPH
+#  if !GNULIB_defined_c32isgraph
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isgraph (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswgraph (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isgraph 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isgraph, int, (wint_t wc), );
 # endif
@@ -324,17 +345,20 @@ _GL_CXXALIASWARN (c32isgraph);
 #endif
 #if @GNULIB_C32ISLOWER@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISLOWER
+#  if !GNULIB_defined_c32islower
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32islower (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswlower (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32islower 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32islower, int, (wint_t wc), );
 # endif
@@ -343,17 +367,20 @@ _GL_CXXALIASWARN (c32islower);
 #endif
 #if @GNULIB_C32ISPRINT@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISPRINT
+#  if !GNULIB_defined_c32isprint
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isprint (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswprint (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isprint 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isprint, int, (wint_t wc), );
 # endif
@@ -362,17 +389,20 @@ _GL_CXXALIASWARN (c32isprint);
 #endif
 #if @GNULIB_C32ISPUNCT@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISPUNCT
+#  if !GNULIB_defined_c32ispunct
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32ispunct (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswpunct (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32ispunct 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32ispunct, int, (wint_t wc), );
 # endif
@@ -381,17 +411,20 @@ _GL_CXXALIASWARN (c32ispunct);
 #endif
 #if @GNULIB_C32ISSPACE@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISSPACE
+#  if !GNULIB_defined_c32isspace
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isspace (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswspace (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isspace 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isspace, int, (wint_t wc), );
 # endif
@@ -400,17 +433,20 @@ _GL_CXXALIASWARN (c32isspace);
 #endif
 #if @GNULIB_C32ISUPPER@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISUPPER
+#  if !GNULIB_defined_c32isupper
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isupper (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswupper (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isupper 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isupper, int, (wint_t wc), );
 # endif
@@ -419,17 +455,20 @@ _GL_CXXALIASWARN (c32isupper);
 #endif
 #if @GNULIB_C32ISXDIGIT@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32ISXDIGIT
+#  if !GNULIB_defined_c32isxdigit
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32isxdigit (wint_t wc)
 {
   return
-#  if @GNULIB_ISWXDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_ISWXDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          iswxdigit (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32isxdigit 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32isxdigit, int, (wint_t wc), );
 # endif
@@ -441,17 +480,20 @@ _GL_CXXALIASWARN (c32isxdigit);
 /* Case mapping of a 32-bit wide character.  */
 #if @GNULIB_C32TOLOWER@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32TOLOWER
+#  if !GNULIB_defined_c32tolower
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE wint_t
 c32tolower (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          towlower (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32tolower 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32tolower, wint_t, (wint_t wc), );
 # endif
@@ -460,17 +502,20 @@ _GL_CXXALIASWARN (c32tolower);
 #endif
 #if @GNULIB_C32TOUPPER@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32TOUPPER
+#  if !GNULIB_defined_c32toupper
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE wint_t
 c32toupper (wint_t wc)
 {
   return
-#  if defined __cplusplus && defined GNULIB_NAMESPACE
+#   if defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          towupper (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32toupper 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32toupper, wint_t, (wint_t wc), );
 # endif
@@ -482,17 +527,20 @@ _GL_CXXALIASWARN (c32toupper);
 /* Number of screen columns needed for a 32-bit wide character.  */
 #if @GNULIB_C32WIDTH@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32WIDTH
+#  if !GNULIB_defined_c32width
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32width (char32_t wc)
 {
   return
-#  if @GNULIB_WCWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wcwidth (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32width 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32width, int, (char32_t wc), );
 # endif
@@ -530,18 +578,21 @@ _GL_WARN_ON_USE (c32rtomb, "c32rtomb is not portable - "
 /* Convert a 32-bit wide string to a string.  */
 #if @GNULIB_C32SNRTOMBS@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32SNRTOMBS
+#  if !GNULIB_defined_c32snrtombs
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 c32snrtombs (char *dest, const char32_t **srcp, size_t srclen, size_t len,
              mbstate_t *ps)
 {
   return
-#  if @GNULIB_WCSNRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCSNRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wcsnrtombs (dest, (const wchar_t **) srcp, srclen, len, ps);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32snrtombs 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32snrtombs, size_t,
                   (char *dest, const char32_t **srcp, size_t srclen, size_t len,
@@ -558,17 +609,20 @@ _GL_CXXALIASWARN (c32snrtombs);
 /* Convert a 32-bit wide string to a string.  */
 #if @GNULIB_C32SRTOMBS@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32SRTOMBS
+#  if !GNULIB_defined_c32srtombs
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 c32srtombs (char *dest, const char32_t **srcp, size_t len, mbstate_t *ps)
 {
   return
-#  if @GNULIB_WCSRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCSRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wcsrtombs (dest, (const wchar_t **) srcp, len, ps);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32srtombs 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32srtombs, size_t,
                   (char *dest, const char32_t **srcp, size_t len,
@@ -585,6 +639,7 @@ _GL_CXXALIASWARN (c32srtombs);
 /* Convert a 32-bit wide string to a string.  */
 #if @GNULIB_C32STOMBS@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32STOMBS
+#  if !GNULIB_defined_c32stombs
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 c32stombs (char *dest, const char32_t *src, size_t len)
@@ -595,6 +650,8 @@ c32stombs (char *dest, const char32_t *src, size_t len)
   return c32srtombs (dest, &src, len, &state);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32stombs 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32stombs, size_t,
                   (char *dest, const char32_t *src, size_t len),
@@ -609,17 +666,20 @@ _GL_CXXALIASWARN (c32stombs);
 /* Number of screen columns needed for a size-bounded 32-bit wide string.  */
 #if @GNULIB_C32SWIDTH@
 # if (_GL_WCHAR_T_IS_UCS4 && !GNULIB_defined_mbstate_t) && !defined IN_C32SWIDTH
+#  if !GNULIB_defined_c32swidth
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((1)) int
 c32swidth (const char32_t *s, size_t n)
 {
   return
-#  if @GNULIB_WCSWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCSWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wcswidth ((const wchar_t *) s, n);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32swidth 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32swidth, int, (const char32_t *s, size_t n),
                                   _GL_ARG_NONNULL ((1)));
@@ -634,17 +694,20 @@ _GL_CXXALIASWARN (c32swidth);
    or EOF otherwise.  */
 #if @GNULIB_C32TOB@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32TOB
+#  if !GNULIB_defined_c32tob
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32tob (wint_t wc)
 {
   return
-#  if @GNULIB_WCTOB@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCTOB@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wctob (wc);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32tob 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32tob, int, (wint_t wc), );
 # endif
@@ -717,18 +780,21 @@ _GL_WARN_ON_USE (mbrtoc16, "mbrtoc16 is not portable - "
 /* Convert a string to a 32-bit wide string.  */
 #if @GNULIB_MBSNRTOC32S@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSNRTOC32S
+#  if !GNULIB_defined_mbsnrtoc32s
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 mbsnrtoc32s (char32_t *dest, const char **srcp, size_t srclen, size_t len,
              mbstate_t *ps)
 {
   return
-#  if @GNULIB_MBSNRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_MBSNRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          mbsnrtowcs ((wchar_t *) dest, srcp, srclen, len, ps);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_mbsnrtoc32s 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (mbsnrtoc32s, size_t,
                   (char32_t *dest, const char **srcp, size_t srclen, size_t len,
@@ -745,17 +811,20 @@ _GL_CXXALIASWARN (mbsnrtoc32s);
 /* Convert a string to a 32-bit wide string.  */
 #if @GNULIB_MBSRTOC32S@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSRTOC32S
+#  if !GNULIB_defined_mbsrtoc32s
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 mbsrtoc32s (char32_t *dest, const char **srcp, size_t len, mbstate_t *ps)
 {
   return
-#  if @GNULIB_MBSRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_MBSRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          mbsrtowcs ((wchar_t *) dest, srcp, len, ps);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_mbsrtoc32s 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (mbsrtoc32s, size_t,
                   (char32_t *dest, const char **srcp, size_t len,
@@ -772,6 +841,7 @@ _GL_CXXALIASWARN (mbsrtoc32s);
 /* Convert a string to a 32-bit wide string.  */
 #if @GNULIB_MBSTOC32S@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_MBSTOC32S
+#  if !GNULIB_defined_mbstoc32s
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) size_t
 mbstoc32s (char32_t *dest, const char *src, size_t len)
@@ -782,6 +852,8 @@ mbstoc32s (char32_t *dest, const char *src, size_t len)
   return mbsrtoc32s (dest, &src, len, &state);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_mbstoc32s 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (mbstoc32s, size_t,
                   (char32_t *dest, const char *src, size_t len),
@@ -813,17 +885,20 @@ typedef /*bool*/int (*c32_type_test_t) (wint_t wc);
  */
 #if @GNULIB_C32_GET_TYPE_TEST@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_GET_TYPE_TEST
+#  if !GNULIB_defined_c32_get_type_test
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((1)) c32_type_test_t
 c32_get_type_test (const char *name)
 {
   return
-#  if @GNULIB_WCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wctype (name);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32_get_type_test 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32_get_type_test, c32_type_test_t, (const char *name),
                                                       _GL_ARG_NONNULL ((1)));
@@ -840,17 +915,20 @@ _GL_CXXALIASWARN (c32_get_type_test);
 #if @GNULIB_C32_APPLY_TYPE_TEST@
 # if _GL_WCHAR_T_IS_UCS4
 #  if !defined IN_C32_APPLY_TYPE_TEST
+#   if !GNULIB_defined_c32_apply_type_test
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE int
 c32_apply_type_test (wint_t wc, c32_type_test_t property)
 {
   return
-#  if @GNULIB_ISWCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#    if @GNULIB_ISWCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#    endif
          iswctype (wc, property);
 }
 _GL_END_C_LINKAGE
+#    define GNULIB_defined_c32_apply_type_test 1
+#   endif
 #  else
 _GL_FUNCDECL_SYS (c32_apply_type_test, int,
                   (wint_t wc, c32_type_test_t property), );
@@ -885,17 +963,20 @@ typedef wint_t (*c32_mapping_t) (wint_t wc);
  */
 #if @GNULIB_C32_GET_MAPPING@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_GET_MAPPING
+#  if !GNULIB_defined_c32_get_mapping
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((1)) c32_mapping_t
 c32_get_mapping (const char *name)
 {
   return
-#  if @GNULIB_WCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_WCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          wctrans (name);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32_get_mapping 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32_get_mapping, c32_mapping_t, (const char *name),
                                                   _GL_ARG_NONNULL ((1)));
@@ -911,17 +992,20 @@ _GL_CXXALIASWARN (c32_get_mapping);
  */
 #if @GNULIB_C32_APPLY_MAPPING@
 # if _GL_WCHAR_T_IS_UCS4 && !defined IN_C32_APPLY_MAPPING
+#  if !GNULIB_defined_c32_apply_mapping
 _GL_BEGIN_C_LINKAGE
 _GL_INLINE _GL_ARG_NONNULL ((2)) wint_t
 c32_apply_mapping (wint_t wc, c32_mapping_t mapping)
 {
   return
-#  if @GNULIB_TOWCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+#   if @GNULIB_TOWCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
          GNULIB_NAMESPACE::
-#  endif
+#   endif
          towctrans (wc, mapping);
 }
 _GL_END_C_LINKAGE
+#   define GNULIB_defined_c32_apply_mapping 1
+#  endif
 # else
 _GL_FUNCDECL_SYS (c32_apply_mapping, wint_t,
                   (wint_t wc, c32_mapping_t mapping),