+2025-10-03 Bruno Haible <bruno@clisp.org>
+
+ unistr, unigbrk: Fix compilation error in C++ mode (regr. 2025-02-09).
+ Reported by Ryan Carsten Schmidt <gnulib@ryandesign.com>
+ at <https://savannah.gnu.org/bugs/?67576>.
+ * lib/unistr.in.h (u*_check, u*_chr, u*_next, u*_prev, u*_strchr,
+ u*_strrchr, u*_strpbrk, u*_strstr): Define C++ templates outside of
+ 'extern "C"' block.
+ * lib/unigbrk.in.h (u*_grapheme_next, u*_grapheme_prev): Likewise.
+
2025-09-28 Collin Funk <collin.funk1@gmail.com>
xsetenv: Revert the previous change.
u32_grapheme_next (const uint32_t *s, const uint32_t *end)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_grapheme_next ((s), (end)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Returns the start of the previous grapheme cluster before S, or NULL if the
u32_grapheme_prev (const uint32_t *s, const uint32_t *start)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_grapheme_prev ((s), (start)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Determine the grapheme cluster boundaries in S, and store the result at
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_check ((s), (n)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
u32_chr (const uint32_t *s, size_t n, ucs4_t uc)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_chr ((s), (n), (u)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Count the number of Unicode characters in the N units from S. */
extern const uint32_t *
u32_next (ucs4_t *puc, const uint32_t *s);
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_next ((p), (s)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Backward iteration step. Advances the pointer to point to the previous
extern const uint32_t *
u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start);
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_prev ((p), (s), (start)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Return the number of units in S. */
u32_strchr (const uint32_t *str, ucs4_t uc)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_strchr ((s), (u)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Find the last occurrence of UC in STR. */
u32_strrchr (const uint32_t *str, ucs4_t uc)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_strrchr ((s), (u)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Return the length of the initial segment of STR which consists entirely
u32_strpbrk (const uint32_t *str, const uint32_t *accept)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_strpbrk ((s), (a)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Find the first occurrence of NEEDLE in HAYSTACK. */
u32_strstr (const uint32_t *haystack, const uint32_t *needle)
_UC_ATTRIBUTE_PURE;
#ifndef _LIBUNISTRING_NO_CONST_GENERICS
+# ifdef __cplusplus
+}
+# endif
/* Don't silently convert a 'const uintN_t *' to a 'uintN_t *'. Programmers
want compiler warnings for 'const' related mistakes. */
# ifdef __cplusplus
default : u32_strstr ((h), (n)))
# endif
# endif
+# ifdef __cplusplus
+extern "C" {
+# endif
#endif
/* Test whether STR starts with PREFIX. */