+2023-09-07 Bruno Haible <bruno@clisp.org>
+
+ uchar: Fix references to overridden functions with GNULIB_NAMESPACE.
+ * lib/uchar.in.h (btoc32, c32isalnum, c32isalpha, c32isblank,
+ c32iscntrl, c32isdigit, c32isgraph, c32islower, c32isprint, c32ispunct,
+ c32isspace, c32isupper, c32isxdigit, c32tolower, c32toupper, c32width,
+ c32snrtombs, c32srtombs, c32swidth, c32tob, mbsnrtoc32s, mbsrtoc32s,
+ c32_get_type_test, c32_apply_type_test, c32_get_mapping,
+ c32_apply_mapping): Use GNULIB_NAMESPACE:: prefix to refer to the gnulib
+ overridden function.
+ * modules/uchar (Depends-on): Add wctype-h.
+ (Makefile.am): Substitute GNULIB_BTOWC, GNULIB_ISWDIGIT,
+ GNULIB_ISWXDIGIT, GNULIB_WCWIDTH, GNULIB_WCSNRTOMBS, GNULIB_WCSRTOMBS,
+ GNULIB_WCSWIDTH, GNULIB_WCTOB, GNULIB_MBSNRTOWCS, GNULIB_MBSRTOWCS,
+ GNULIB_WCTYPE, GNULIB_ISWCTYPE, GNULIB_WCTRANS, GNULIB_TOWCTRANS.
+
2023-09-07 Bruno Haible <bruno@clisp.org>
tests: Fix some clang -Wimplicit-fallthrough warnings.
_GL_INLINE _GL_ATTRIBUTE_PURE wint_t
btoc32 (int c)
{
- return btowc (c);
+ return
+# if @GNULIB_BTOWC@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ btowc (c);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isalnum (wint_t wc)
{
- return iswalnum (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswalnum (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isalpha (wint_t wc)
{
- return iswalpha (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswalpha (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isblank (wint_t wc)
{
- return iswblank (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswblank (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32iscntrl (wint_t wc)
{
- return iswcntrl (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswcntrl (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isdigit (wint_t wc)
{
- return iswdigit (wc);
+ return
+# if @GNULIB_ISWDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswdigit (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isgraph (wint_t wc)
{
- return iswgraph (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswgraph (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32islower (wint_t wc)
{
- return iswlower (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswlower (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isprint (wint_t wc)
{
- return iswprint (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswprint (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32ispunct (wint_t wc)
{
- return iswpunct (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswpunct (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isspace (wint_t wc)
{
- return iswspace (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswspace (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isupper (wint_t wc)
{
- return iswupper (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswupper (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32isxdigit (wint_t wc)
{
- return iswxdigit (wc);
+ return
+# if @GNULIB_ISWXDIGIT@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswxdigit (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE wint_t
c32tolower (wint_t wc)
{
- return towlower (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ towlower (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE wint_t
c32toupper (wint_t wc)
{
- return towupper (wc);
+ return
+# if defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ towupper (wc);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32width (char32_t wc)
{
- return wcwidth (wc);
+ return
+# if @GNULIB_WCWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wcwidth (wc);
}
_GL_END_C_LINKAGE
# else
c32snrtombs (char *dest, const char32_t **srcp, size_t srclen, size_t len,
mbstate_t *ps)
{
- return wcsnrtombs (dest, (const wchar_t **) srcp, srclen, len, ps);
+ return
+# if @GNULIB_WCSNRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wcsnrtombs (dest, (const wchar_t **) srcp, srclen, len, ps);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((2)) size_t
c32srtombs (char *dest, const char32_t **srcp, size_t len, mbstate_t *ps)
{
- return wcsrtombs (dest, (const wchar_t **) srcp, len, ps);
+ return
+# if @GNULIB_WCSRTOMBS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wcsrtombs (dest, (const wchar_t **) srcp, len, ps);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((1)) int
c32swidth (const char32_t *s, size_t n)
{
- return wcswidth ((const wchar_t *) s, n);
+ return
+# if @GNULIB_WCSWIDTH@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wcswidth ((const wchar_t *) s, n);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32tob (wint_t wc)
{
- return wctob (wc);
+ return
+# if @GNULIB_WCTOB@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wctob (wc);
}
_GL_END_C_LINKAGE
# else
mbsnrtoc32s (char32_t *dest, const char **srcp, size_t srclen, size_t len,
mbstate_t *ps)
{
- return mbsnrtowcs ((wchar_t *) dest, srcp, srclen, len, ps);
+ return
+# if @GNULIB_MBSNRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ mbsnrtowcs ((wchar_t *) dest, srcp, srclen, len, ps);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((2)) size_t
mbsrtoc32s (char32_t *dest, const char **srcp, size_t len, mbstate_t *ps)
{
- return mbsrtowcs ((wchar_t *) dest, srcp, len, ps);
+ return
+# if @GNULIB_MBSRTOWCS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ mbsrtowcs ((wchar_t *) dest, srcp, len, ps);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((1)) c32_type_test_t
c32_get_type_test (const char *name)
{
- return wctype (name);
+ return
+# if @GNULIB_WCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wctype (name);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE int
c32_apply_type_test (wint_t wc, c32_type_test_t property)
{
- return iswctype (wc, property);
+ return
+# if @GNULIB_ISWCTYPE@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ iswctype (wc, property);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((1)) c32_mapping_t
c32_get_mapping (const char *name)
{
- return wctrans (name);
+ return
+# if @GNULIB_WCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ wctrans (name);
}
_GL_END_C_LINKAGE
# else
_GL_INLINE _GL_ARG_NONNULL ((2)) wint_t
c32_apply_mapping (wint_t wc, c32_mapping_t mapping)
{
- return towctrans (wc, mapping);
+ return
+# if @GNULIB_TOWCTRANS@ && defined __cplusplus && defined GNULIB_NAMESPACE
+ GNULIB_NAMESPACE::
+# endif
+ towctrans (wc, mapping);
}
_GL_END_C_LINKAGE
# else
assert-h
stdint
wchar
+wctype-h
configure.ac:
gl_UCHAR_H
-e 's|@''GNULIBHEADERS_OVERRIDE_CHAR16_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR16_T)|g' \
-e 's|@''GNULIBHEADERS_OVERRIDE_CHAR32_T''@|$(GNULIBHEADERS_OVERRIDE_CHAR32_T)|g' \
-e 's/@''GNULIB_BTOC32''@/$(GNULIB_BTOC32)/g' \
+ -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
-e 's/@''GNULIB_C32ISALNUM''@/$(GNULIB_C32ISALNUM)/g' \
-e 's/@''GNULIB_C32ISALPHA''@/$(GNULIB_C32ISALPHA)/g' \
-e 's/@''GNULIB_C32ISBLANK''@/$(GNULIB_C32ISBLANK)/g' \
-e 's/@''GNULIB_C32_APPLY_TYPE_TEST''@/$(GNULIB_C32_APPLY_TYPE_TEST)/g' \
-e 's/@''GNULIB_C32_GET_MAPPING''@/$(GNULIB_C32_GET_MAPPING)/g' \
-e 's/@''GNULIB_C32_GET_TYPE_TEST''@/$(GNULIB_C32_GET_TYPE_TEST)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
+ -e 's/@''GNULIB_ISWDIGIT''@/$(GNULIB_ISWDIGIT)/g' \
+ -e 's/@''GNULIB_ISWXDIGIT''@/$(GNULIB_ISWXDIGIT)/g' \
-e 's/@''GNULIB_MBRTOC16''@/$(GNULIB_MBRTOC16)/g' \
-e 's/@''GNULIB_MBRTOC32''@/$(GNULIB_MBRTOC32)/g' \
-e 's/@''GNULIB_MBSNRTOC32S''@/$(GNULIB_MBSNRTOC32S)/g' \
+ -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
-e 's/@''GNULIB_MBSRTOC32S''@/$(GNULIB_MBSRTOC32S)/g' \
+ -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
-e 's/@''GNULIB_MBSTOC32S''@/$(GNULIB_MBSTOC32S)/g' \
+ -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+ -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
+ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
+ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
+ -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
+ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
-e 's|@''HAVE_C32RTOMB''@|$(HAVE_C32RTOMB)|g' \
-e 's|@''HAVE_MBRTOC16''@|$(HAVE_MBRTOC16)|g' \
-e 's|@''HAVE_MBRTOC32''@|$(HAVE_MBRTOC32)|g' \