Fix compilation error in C++ mode (regr. 2025-02-09).

* 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.

https://savannah.gnu.org/bugs/?67576
https://gitweb.git.savannah.gnu.org/gitweb/?p=gnulib.git;a=patch;h=3f2b934a627d29cbf9ef4d4fc3c63b46968a6312
--- lib/unigbrk.in.h.orig	2025-02-24 02:10:58.000000000 -0600
+++ lib/unigbrk.in.h	2025-10-03 15:30:27.000000000 -0500
@@ -111,6 +111,9 @@
        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
@@ -176,6 +179,9 @@
                 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
@@ -192,6 +198,9 @@
        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
@@ -257,6 +266,9 @@
                 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
--- lib/unistr.in.h.orig	2025-09-27 09:33:29.000000000 -0500
+++ lib/unistr.in.h	2025-10-03 15:30:27.000000000 -0500
@@ -88,6 +88,9 @@
        _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
@@ -153,6 +156,9 @@
                 default   :              u32_check ((s), (n)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 
@@ -519,6 +525,9 @@
        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
@@ -584,6 +593,9 @@
                 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.  */
@@ -642,6 +654,9 @@
 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
@@ -707,6 +722,9 @@
                 default   :              u32_next ((p), (s)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 /* Backward iteration step.  Advances the pointer to point to the previous
@@ -719,6 +737,9 @@
 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
@@ -784,6 +805,9 @@
                 default   :              u32_prev ((p), (s), (start)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 /* Return the number of units in S.  */
@@ -932,6 +956,9 @@
        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
@@ -997,6 +1024,9 @@
                 default         :                    u32_strchr ((s), (u)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 /* Find the last occurrence of UC in STR.  */
@@ -1011,6 +1041,9 @@
        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
@@ -1076,6 +1109,9 @@
                 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
@@ -1116,6 +1152,9 @@
        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
@@ -1181,6 +1220,9 @@
                 default         :                    u32_strpbrk ((s), (a)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 /* Find the first occurrence of NEEDLE in HAYSTACK.  */
@@ -1195,6 +1237,9 @@
        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
@@ -1260,6 +1305,9 @@
                 default         :                    u32_strstr ((h), (n)))
 #  endif
 # endif
+# ifdef __cplusplus
+extern "C" {
+# endif
 #endif
 
 /* Test whether STR starts with PREFIX.  */
