Paul Eggert wrote:
> > Do you mean, we should also move from gl_<something> to _gl_<something>
> > for non-public API
> 
> Probably would be a good idea, no? But not urgent.

Here are proposed patches to make the non-public function and
macro names consistent.


2026-03-15  Bruno Haible  <[email protected]>

        posix_spawn-internal: Move private Gnulib functions to _gl_* namespace.
        * lib/spawn_int.h (_gl_posix_spawn_file_actions_realloc): Renamed from
        gl_posix_spawn_file_actions_realloc.
        (_gl_posix_spawn_internal): Renamed from gl_posix_spawn_internal.

2026-03-15  Bruno Haible  <[email protected]>

        locale-h: Move private Gnulib functions to _gl_* namespace.
        * lib/locale.in.h (_gl_log2_lc_mask): Renamed from gl_log2_lc_mask.
        (_gl_log2_lcmask_to_index): Renamed from gl_log2_lcmask_to_index.
        (_gl_index_to_log2_lcmask): Renamed from gl_index_to_log2_lcmask.
        * lib/duplocale.c: Update.
        * lib/freelocale.c: Update.
        * lib/newlocale.c: Update.
        * lib/getlocalename_l-unsafe.c: Update.
        * lib/is_l-impl.h: Update.
        * lib/to_l-impl.h: Update.
        * lib/strcasecmp_l.c: Update.
        * lib/strncasecmp_l.c: Update.
        * lib/strerror_l.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        strnul: Move private Gnulib functions to _gl_* namespace.
        * lib/string.in.h (_gl_strnul): Renamed from gl_strnul.
        * lib/strnul.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        stdlib-h: Move private Gnulib functions to _gl_* namespace.
        * lib/stdlib.in.h (_gl_MB_CUR_MAX): Renamed from gl_MB_CUR_MAX.

2026-03-15  Bruno Haible  <[email protected]>

        stdio-h, stdio-windows: Move private Gnulib functions to _gl_* 
namespace.
        * lib/stdio.in.h (_gl_consolesafe_fwrite): Renamed from
        gl_consolesafe_fwrite.
        (_gl_consolesafe_fprintf): Renamed from gl_consolesafe_fprintf.
        (_gl_consolesafe_printf): Renamed from gl_consolesafe_printf.
        (_gl_consolesafe_vfprintf): Renamed from gl_consolesafe_vfprintf.
        (_gl_consolesafe_vprintf): Renamed from gl_consolesafe_vprintf.
        * lib/stdio-consolesafe.c: Update.
        * lib/stdio-write.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        math-h: Move private Gnulib functions to _gl_* namespace.
        * lib/math.in.h (_gl_isfinitef): Renamed from gl_isfinitef.
        (_gl_isfinited): Renamed from gl_isfinited.
        (_gl_isfinitel): Renamed from gl_isfinitel.
        (_gl_isinff): Renamed from gl_isinff.
        (_gl_isinfd): Renamed from gl_isinfd.
        (_gl_isinfl): Renamed from gl_isinfl.
        (_gl_isnanf): Renamed from gl_isnan_f.
        (_gl_isnand): Renamed from gl_isnan_d.
        (_gl_isnanl): Renamed from gl_isnan_l.
        (_gl_signbitf): Renamed from gl_signbitf.
        (_gl_signbitf_OPTIMIZED_MACRO): Renamed from
        gl_signbitf_OPTIMIZED_MACRO.
        (_gl_signbitd): Renamed from gl_signbitd.
        (_gl_signbitd_OPTIMIZED_MACRO): Renamed from
        gl_signbitd_OPTIMIZED_MACRO.
        (_gl_signbitl): Renamed from gl_signbitl.
        (_gl_signbitl_OPTIMIZED_MACRO): Renamed from
        gl_signbitl_OPTIMIZED_MACRO.
        * lib/isfinite.c: Update.
        * lib/isinf.c: Update.
        * lib/signbitf.c: Update.
        * lib/signbitd.c: Update.
        * lib/signbitl.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        float-h: Move private Gnulib data to _gl_* namespace.
        * lib/float.in.h (_gl_LDBL_MAX): Renamed from gl_LDBL_MAX.
        (_gl_LDBL_TRUE_MIN): Renamed from gl_LDBL_TRUE_MIN.
        (_gl_FLT_SNAN): Renamed from gl_FLT_SNAN.
        (_gl_DBL_SNAN): Renamed from gl_DBL_SNAN.
        (_gl_LDBL_SNAN): Renamed from gl_LDBL_SNAN.
        * lib/float.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        expl, exp2l: Move private Gnulib data to _gl_* namespace.
        * lib/expl-table.c (_gl_expl_table): Renamed from gl_expl_table.
        * lib/expl.c: Update.
        * lib/exp2l.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        msvc-inval: Move private Gnulib functions to _gl_* namespace.
        * lib/msvc-inval.h (_gl_msvc_inval_current): Renamed from
        gl_msvc_inval_current.
        * lib/msvc-inval.c: Update.

2026-03-15  Bruno Haible  <[email protected]>

        glibc-internal/scratch_buffer: Move private Gnulib functions to _gl_* 
namespace.
        * lib/scratch_buffer.h (__libc_scratch_buffer_*): Define to symbols in
        the _gl_* namespace.

2026-03-15  Bruno Haible  <[email protected]>

        glibc-internal/dynarray: Move private Gnulib functions to _gl_* 
namespace.
        * lib/dynarray.h (__libc_dynarray_*): Define to symbols in the _gl_*
        namespace.

2026-03-15  Bruno Haible  <[email protected]>

        at-init: Move private Gnulib functions to _gl_* namespace.
        * lib/at-init.h (_gl_at_init_dummy): Renamed from gl_at_init_dummy.
        * lib/at-init.c: Update.


>From 89c23c79a33df265d36f500a896754d91120daec Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 18:38:48 +0100
Subject: [PATCH 01/12] at-init: Move private Gnulib functions to _gl_*
 namespace.

* lib/at-init.h (_gl_at_init_dummy): Renamed from gl_at_init_dummy.
* lib/at-init.c: Update.
---
 ChangeLog     | 6 ++++++
 lib/at-init.c | 2 +-
 lib/at-init.h | 6 +++---
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b5c4cc6bdb..fa2a5300eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	at-init: Move private Gnulib functions to _gl_* namespace.
+	* lib/at-init.h (_gl_at_init_dummy): Renamed from gl_at_init_dummy.
+	* lib/at-init.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	stdc_memreverse8: Add tests.
diff --git a/lib/at-init.c b/lib/at-init.c
index f33f876267..bbd4e7dd82 100644
--- a/lib/at-init.c
+++ b/lib/at-init.c
@@ -22,7 +22,7 @@
 #if defined _MSC_VER
 
 void
-gl_at_init_dummy (_GL_UNUSED const void *p)
+_gl_at_init_dummy (_GL_UNUSED const void *p)
 {
 }
 
diff --git a/lib/at-init.h b/lib/at-init.h
index 888c701840..13dd824ea8 100644
--- a/lib/at-init.h
+++ b/lib/at-init.h
@@ -85,7 +85,7 @@
   static void function(void); \
   extern int (* _array ## function)(void); \
   int function ## _wrapper(void); \
-  int function ## _wrapper(void) { function(); gl_at_init_dummy (_array ## function); return 0; } \
+  int function ## _wrapper(void) { function(); _gl_at_init_dummy (_array ## function); return 0; } \
   __pragma(comment(linker,"/include:" _sym_prefix # function "_wrapper")) \
   __pragma(section(".CRT$XCU",read)) \
   __declspec(allocate(".CRT$XCU")) int (* _array ## function)(void) = function ## _wrapper
@@ -94,12 +94,12 @@
   static void function(void); \
   extern int (* _array ## function)(void); \
   int function ## _constructor(void); \
-  int function ## _constructor(void) { atexit (function); gl_at_init_dummy (_array ## function); return 0; } \
+  int function ## _constructor(void) { atexit (function); _gl_at_init_dummy (_array ## function); return 0; } \
    __pragma(comment(linker,"/include:" _sym_prefix # function "_constructor")) \
   __pragma(section(".CRT$XCU",read)) \
   __declspec(allocate(".CRT$XCU")) int (* _array ## function)(void) = function ## _constructor
 
-extern void gl_at_init_dummy (const void *);
+extern void _gl_at_init_dummy (const void *);
 
 #elif defined __SUNPRO_C
 /* Sun C */
-- 
2.52.0

>From 4664e8d6d8c3f669270ec3ba8e308826881e3935 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 18:45:07 +0100
Subject: [PATCH 02/12] glibc-internal/dynarray: Move private Gnulib functions
 to _gl_* namespace.

* lib/dynarray.h (__libc_dynarray_*): Define to symbols in the _gl_*
namespace.
---
 ChangeLog      |  6 ++++++
 lib/dynarray.h | 10 +++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa2a5300eb..8abb075a1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	glibc-internal/dynarray: Move private Gnulib functions to _gl_* namespace.
+	* lib/dynarray.h (__libc_dynarray_*): Define to symbols in the _gl_*
+	namespace.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	at-init: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/dynarray.h b/lib/dynarray.h
index a5cdf630e5..256340462d 100644
--- a/lib/dynarray.h
+++ b/lib/dynarray.h
@@ -249,11 +249,11 @@ static DYNARRAY_ELEMENT *
 /* The implementation is imported from glibc.  */
 
 /* Avoid possible conflicts with symbols exported by the GNU libc.  */
-#define __libc_dynarray_at_failure gl_dynarray_at_failure
-#define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge
-#define __libc_dynarray_finalize gl_dynarray_finalize
-#define __libc_dynarray_resize_clear gl_dynarray_resize_clear
-#define __libc_dynarray_resize gl_dynarray_resize
+#define __libc_dynarray_at_failure _gl_dynarray_at_failure
+#define __libc_dynarray_emplace_enlarge _gl_dynarray_emplace_enlarge
+#define __libc_dynarray_finalize _gl_dynarray_finalize
+#define __libc_dynarray_resize_clear _gl_dynarray_resize_clear
+#define __libc_dynarray_resize _gl_dynarray_resize
 
 #if defined DYNARRAY_STRUCT || defined DYNARRAY_ELEMENT || defined DYNARRAY_PREFIX
 
-- 
2.52.0

>From 11774ff8291b18bec596efe817602b1993ad2f44 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 18:50:24 +0100
Subject: [PATCH 03/12] glibc-internal/scratch_buffer: Move private Gnulib
 functions to _gl_* namespace.

* lib/scratch_buffer.h (__libc_scratch_buffer_*): Define to symbols in
the _gl_* namespace.
---
 ChangeLog            | 6 ++++++
 lib/scratch_buffer.h | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8abb075a1c..fb35e32899 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	glibc-internal/scratch_buffer: Move private Gnulib functions to _gl_* namespace.
+	* lib/scratch_buffer.h (__libc_scratch_buffer_*): Define to symbols in
+	the _gl_* namespace.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	glibc-internal/dynarray: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/scratch_buffer.h b/lib/scratch_buffer.h
index 1185a8e452..5fc582fe9e 100644
--- a/lib/scratch_buffer.h
+++ b/lib/scratch_buffer.h
@@ -102,9 +102,9 @@ extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer,
 /* The implementation is imported from glibc.  */
 
 /* Avoid possible conflicts with symbols exported by the GNU libc.  */
-#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
-#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
-#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
+#define __libc_scratch_buffer_grow _gl_scratch_buffer_grow
+#define __libc_scratch_buffer_grow_preserve _gl_scratch_buffer_grow_preserve
+#define __libc_scratch_buffer_set_array_size _gl_scratch_buffer_set_array_size
 
 #ifndef _GL_LIKELY
 /* Rely on __builtin_expect, as provided by the module 'builtin-expect'.  */
-- 
2.52.0

>From 3d7dd59598c0bd766171f1d46d5eadfd81bb4119 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 19:32:44 +0100
Subject: [PATCH 04/12] msvc-inval: Move private Gnulib functions to _gl_*
 namespace.

* lib/msvc-inval.h (_gl_msvc_inval_current): Renamed from
gl_msvc_inval_current.
* lib/msvc-inval.c: Update.
---
 ChangeLog        | 7 +++++++
 lib/msvc-inval.c | 4 ++--
 lib/msvc-inval.h | 4 ++--
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fb35e32899..0af29a04d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	msvc-inval: Move private Gnulib functions to _gl_* namespace.
+	* lib/msvc-inval.h (_gl_msvc_inval_current): Renamed from
+	gl_msvc_inval_current.
+	* lib/msvc-inval.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	glibc-internal/scratch_buffer: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/msvc-inval.c b/lib/msvc-inval.c
index 774447b66f..46a3b85e2b 100644
--- a/lib/msvc-inval.c
+++ b/lib/msvc-inval.c
@@ -65,7 +65,7 @@ static int tls_initialized /* = 0 */;
 static struct gl_msvc_inval_per_thread not_per_thread;
 
 struct gl_msvc_inval_per_thread *
-gl_msvc_inval_current (void)
+_gl_msvc_inval_current (void)
 {
   if (!tls_initialized)
     {
@@ -101,7 +101,7 @@ gl_msvc_invalid_parameter_handler (const wchar_t *expression,
                                    unsigned int line,
                                    uintptr_t dummy)
 {
-  struct gl_msvc_inval_per_thread *current = gl_msvc_inval_current ();
+  struct gl_msvc_inval_per_thread *current = _gl_msvc_inval_current ();
   if (current->restart_valid)
     longjmp (current->restart, 1);
   else
diff --git a/lib/msvc-inval.h b/lib/msvc-inval.h
index 25bb6a3ace..7b5f399894 100644
--- a/lib/msvc-inval.h
+++ b/lib/msvc-inval.h
@@ -170,7 +170,7 @@ struct gl_msvc_inval_per_thread
 extern void gl_msvc_inval_ensure_handler (void);
 
 /* Return a pointer to the per-thread data for the current thread.  */
-extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
+extern struct gl_msvc_inval_per_thread *_gl_msvc_inval_current (void);
 
 #   ifdef __cplusplus
 }
@@ -181,7 +181,7 @@ extern struct gl_msvc_inval_per_thread *gl_msvc_inval_current (void);
         {                                                                      \
           gl_msvc_inval_ensure_handler ();                                     \
           struct gl_msvc_inval_per_thread *msvc_inval_current =                \
-            gl_msvc_inval_current ();                                          \
+            _gl_msvc_inval_current ();                                         \
           /* First, initialize gl_msvc_inval_restart.  */                      \
           if (setjmp (msvc_inval_current->restart) == 0)                       \
             {                                                                  \
-- 
2.52.0

>From 33961b81cf6480416a56d3cf3e19ae27b60c083d Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 19:36:31 +0100
Subject: [PATCH 05/12] expl, exp2l: Move private Gnulib data to _gl_*
 namespace.

* lib/expl-table.c (_gl_expl_table): Renamed from gl_expl_table.
* lib/expl.c: Update.
* lib/exp2l.c: Update.
---
 ChangeLog        | 7 +++++++
 lib/exp2l.c      | 6 +++---
 lib/expl-table.c | 4 ++--
 lib/expl.c       | 6 +++---
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0af29a04d6..25f2c7b226 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	expl, exp2l: Move private Gnulib data to _gl_* namespace.
+	* lib/expl-table.c (_gl_expl_table): Renamed from gl_expl_table.
+	* lib/expl.c: Update.
+	* lib/exp2l.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	msvc-inval: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/exp2l.c b/lib/exp2l.c
index c433047c7a..066d35280e 100644
--- a/lib/exp2l.c
+++ b/lib/exp2l.c
@@ -31,8 +31,8 @@ exp2l (long double x)
 
 # include <float.h>
 
-/* gl_expl_table[i] = exp((i - 128) * log(2)/256).  */
-extern const long double gl_expl_table[257];
+/* _gl_expl_table[i] = exp((i - 128) * log(2)/256).  */
+extern const long double _gl_expl_table[257];
 
 /* Best possible approximation of log(2) as a 'long double'.  */
 #define LOG2 0.693147180559945309417232121458176568075L
@@ -129,7 +129,7 @@ exp2l (long double x)
     int n = (int) roundl (nm * (1.0L / 256.0L));
     int m = (int) nm - 256 * n;
 
-    return ldexpl (gl_expl_table[128 + m] * exp_y, n);
+    return ldexpl (_gl_expl_table[128 + m] * exp_y, n);
   }
 }
 
diff --git a/lib/expl-table.c b/lib/expl-table.c
index 303081730e..5f22ca6177 100644
--- a/lib/expl-table.c
+++ b/lib/expl-table.c
@@ -16,7 +16,7 @@
 
 #include <config.h>
 
-/* gl_expl_table[i] = exp((i - 128) * log(2)/256).
+/* _gl_expl_table[i] = exp((i - 128) * log(2)/256).
    Computed in GNU clisp through
      (setf (long-float-digits) 128)
      (setq a 0L0)
@@ -24,7 +24,7 @@
      (dotimes (i 257)
        (format t "    ~D,~%"
                (float (exp (* (/ (- i 128) 256) (log 2L0))) a)))  */
-const long double gl_expl_table[257] =
+const long double _gl_expl_table[257] =
   {
     0.707106781186547524400844362104849039284L,
     0.709023942160207598920563322257676190836L,
diff --git a/lib/expl.c b/lib/expl.c
index 93b91638e5..9db7ee8522 100644
--- a/lib/expl.c
+++ b/lib/expl.c
@@ -31,8 +31,8 @@ expl (long double x)
 
 # include <float.h>
 
-/* gl_expl_table[i] = exp((i - 128) * log(2)/256).  */
-extern const long double gl_expl_table[257];
+/* _gl_expl_table[i] = exp((i - 128) * log(2)/256).  */
+extern const long double _gl_expl_table[257];
 
 /* A value slightly larger than log(2).  */
 #define LOG2_PLUS_EPSILON 0.6931471805599454L
@@ -143,7 +143,7 @@ expl (long double x)
     int n = (int) roundl (nm * (1.0L / 256.0L));
     int m = (int) nm - 256 * n;
 
-    return ldexpl (gl_expl_table[128 + m] * exp_y, n);
+    return ldexpl (_gl_expl_table[128 + m] * exp_y, n);
   }
 }
 
-- 
2.52.0

>From 88456cd298d3b3e7d1cadbedebbd7667898d0a65 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 19:42:36 +0100
Subject: [PATCH 06/12] float-h: Move private Gnulib data to _gl_* namespace.

* lib/float.in.h (_gl_LDBL_MAX): Renamed from gl_LDBL_MAX.
(_gl_LDBL_TRUE_MIN): Renamed from gl_LDBL_TRUE_MIN.
(_gl_FLT_SNAN): Renamed from gl_FLT_SNAN.
(_gl_DBL_SNAN): Renamed from gl_DBL_SNAN.
(_gl_LDBL_SNAN): Renamed from gl_LDBL_SNAN.
* lib/float.c: Update.
---
 ChangeLog      | 10 ++++++++++
 lib/float.c    | 10 +++++-----
 lib/float.in.h | 20 ++++++++++----------
 3 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 25f2c7b226..9e06249095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	float-h: Move private Gnulib data to _gl_* namespace.
+	* lib/float.in.h (_gl_LDBL_MAX): Renamed from gl_LDBL_MAX.
+	(_gl_LDBL_TRUE_MIN): Renamed from gl_LDBL_TRUE_MIN.
+	(_gl_FLT_SNAN): Renamed from gl_FLT_SNAN.
+	(_gl_DBL_SNAN): Renamed from gl_DBL_SNAN.
+	(_gl_LDBL_SNAN): Renamed from gl_LDBL_SNAN.
+	* lib/float.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	expl, exp2l: Move private Gnulib data to _gl_* namespace.
diff --git a/lib/float.c b/lib/float.c
index 2e95957ac4..4efe812c2f 100644
--- a/lib/float.c
+++ b/lib/float.c
@@ -22,7 +22,7 @@
 
 #if GNULIB_defined_long_double_union
 # ifdef __i386__
-const union gl_long_double_union gl_LDBL_MAX =
+const union gl_long_double_union _gl_LDBL_MAX =
   { { 0xFFFFFFFF, 0xFFFFFFFF, 32766 } };
 # endif
 # if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
@@ -31,7 +31,7 @@ const union gl_long_double_union gl_LDBL_MAX =
    END_LONG_DOUBLE_ROUNDING invocations.  It simpler to just write down the
    representation of LDBL_TRUE_MIN, based on
    <https://en.wikipedia.org/wiki/Extended_precision#x86_extended_precision_format>.  */
-const union gl_long_double_union gl_LDBL_TRUE_MIN =
+const union gl_long_double_union _gl_LDBL_TRUE_MIN =
   { { 0x00000001, 0x00000000, 0 } };
 # endif
 #endif
@@ -39,7 +39,7 @@ const union gl_long_double_union gl_LDBL_TRUE_MIN =
 #if GNULIB_defined_FLT_SNAN
 /* Define like memory_positive_SNaNf(), see signed-snan.h and snan.h,
    or like setpayloadsigf() with an arbitrary payload.  */
-gl_FLT_SNAN_t gl_FLT_SNAN =
+gl_FLT_SNAN_t _gl_FLT_SNAN =
 # if FLT_MANT_DIG == 24
 #  if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
   /* sign bit: 0, 8 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
@@ -55,7 +55,7 @@ gl_FLT_SNAN_t gl_FLT_SNAN =
 #if GNULIB_defined_DBL_SNAN
 /* Define like memory_positive_SNaNd(), see signed-snan.h and snan.h,
    or like setpayloadsig() with an arbitrary payload.  */
-gl_DBL_SNAN_t gl_DBL_SNAN =
+gl_DBL_SNAN_t _gl_DBL_SNAN =
 # if DBL_MANT_DIG == 53
 #  if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
   /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
@@ -76,7 +76,7 @@ gl_DBL_SNAN_t gl_DBL_SNAN =
 # endif
 /* Define like memory_positive_SNaNl(), see signed-snan.h and snan.h,
    or like setpayloadsigl() with an arbitrary payload.  */
-gl_LDBL_SNAN_t gl_LDBL_SNAN =
+gl_LDBL_SNAN_t _gl_LDBL_SNAN =
 # if LDBL_MANT_DIG == 53 /* on arm, hppa, mips, sh, but also MSVC */
 #  if defined __hppa || (defined __mips__ && !MIPS_NAN2008_FLOAT) || defined __sh__
   /* sign bit: 0, 11 exponent bits: all 1, next bit: 1, payload: 0b10...0 */
diff --git a/lib/float.in.h b/lib/float.in.h
index 9f735cb928..15b8184303 100644
--- a/lib/float.in.h
+++ b/lib/float.in.h
@@ -103,8 +103,8 @@ union gl_long_double_union
   };
 #  define GNULIB_defined_long_double_union 1
 # endif
-extern const union gl_long_double_union gl_LDBL_MAX;
-# define LDBL_MAX (gl_LDBL_MAX.ld)
+extern const union gl_long_double_union _gl_LDBL_MAX;
+# define LDBL_MAX (_gl_LDBL_MAX.ld)
 /* Minimum e such that 10^e is in the range of normalized numbers.  */
 # undef LDBL_MIN_10_EXP
 # define LDBL_MIN_10_EXP (-4931)
@@ -207,8 +207,8 @@ extern const union gl_long_double_union gl_LDBL_MAX;
 # elif LDBL_MANT_DIG == 64
 #  if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
 /* Work around FreeBSD/x86 problem mentioned above.  */
-extern const union gl_long_double_union gl_LDBL_TRUE_MIN;
-#   define LDBL_TRUE_MIN (gl_LDBL_TRUE_MIN.ld)
+extern const union gl_long_double_union _gl_LDBL_TRUE_MIN;
+#   define LDBL_TRUE_MIN (_gl_LDBL_TRUE_MIN.ld)
 #  else
 #   define LDBL_TRUE_MIN (LDBL_MIN / 9223372036854775808.0L)
 #  endif
@@ -239,8 +239,8 @@ extern const union gl_long_double_union gl_LDBL_TRUE_MIN;
 #  define FLT_SNAN __builtin_nansf ("")
 # else
 typedef union { unsigned int word[1]; float value; } gl_FLT_SNAN_t;
-extern gl_FLT_SNAN_t gl_FLT_SNAN;
-#  define FLT_SNAN (gl_FLT_SNAN.value)
+extern gl_FLT_SNAN_t _gl_FLT_SNAN;
+#  define FLT_SNAN (_gl_FLT_SNAN.value)
 #  define GNULIB_defined_FLT_SNAN 1
 # endif
 #endif
@@ -263,8 +263,8 @@ extern gl_FLT_SNAN_t gl_FLT_SNAN;
 #  define DBL_SNAN __builtin_nans ("")
 # else
 typedef union { unsigned long long word[1]; double value; } gl_DBL_SNAN_t;
-extern gl_DBL_SNAN_t gl_DBL_SNAN;
-#  define DBL_SNAN (gl_DBL_SNAN.value)
+extern gl_DBL_SNAN_t _gl_DBL_SNAN;
+#  define DBL_SNAN (_gl_DBL_SNAN.value)
 #  define GNULIB_defined_DBL_SNAN 1
 # endif
 #endif
@@ -301,8 +301,8 @@ typedef union { unsigned int word[3]; long double value; } gl_LDBL_SNAN_t;
 #  else
 typedef union { unsigned long long word[2]; long double value; } gl_LDBL_SNAN_t;
 #  endif
-extern gl_LDBL_SNAN_t gl_LDBL_SNAN;
-#  define LDBL_SNAN (gl_LDBL_SNAN.value)
+extern gl_LDBL_SNAN_t _gl_LDBL_SNAN;
+#  define LDBL_SNAN (_gl_LDBL_SNAN.value)
 #  define GNULIB_defined_LDBL_SNAN 1
 # endif
 #endif
-- 
2.52.0

>From 3dbb960fea6c907b0d76789ec657eec7222ba73a Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:33:08 +0100
Subject: [PATCH 07/12] math-h: Move private Gnulib functions to _gl_*
 namespace.

* lib/math.in.h (_gl_isfinitef): Renamed from gl_isfinitef.
(_gl_isfinited): Renamed from gl_isfinited.
(_gl_isfinitel): Renamed from gl_isfinitel.
(_gl_isinff): Renamed from gl_isinff.
(_gl_isinfd): Renamed from gl_isinfd.
(_gl_isinfl): Renamed from gl_isinfl.
(_gl_isnanf): Renamed from gl_isnan_f.
(_gl_isnand): Renamed from gl_isnan_d.
(_gl_isnanl): Renamed from gl_isnan_l.
(_gl_signbitf): Renamed from gl_signbitf.
(_gl_signbitf_OPTIMIZED_MACRO): Renamed from
gl_signbitf_OPTIMIZED_MACRO.
(_gl_signbitd): Renamed from gl_signbitd.
(_gl_signbitd_OPTIMIZED_MACRO): Renamed from
gl_signbitd_OPTIMIZED_MACRO.
(_gl_signbitl): Renamed from gl_signbitl.
(_gl_signbitl_OPTIMIZED_MACRO): Renamed from
gl_signbitl_OPTIMIZED_MACRO.
* lib/isfinite.c: Update.
* lib/isinf.c: Update.
* lib/signbitf.c: Update.
* lib/signbitd.c: Update.
* lib/signbitl.c: Update.
---
 ChangeLog      | 27 ++++++++++++++
 lib/isfinite.c |  6 ++--
 lib/isinf.c    |  6 ++--
 lib/math.in.h  | 96 +++++++++++++++++++++++++-------------------------
 lib/signbitd.c |  6 ++--
 lib/signbitf.c |  6 ++--
 lib/signbitl.c |  6 ++--
 7 files changed, 90 insertions(+), 63 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e06249095..73ca1c4c77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	math-h: Move private Gnulib functions to _gl_* namespace.
+	* lib/math.in.h (_gl_isfinitef): Renamed from gl_isfinitef.
+	(_gl_isfinited): Renamed from gl_isfinited.
+	(_gl_isfinitel): Renamed from gl_isfinitel.
+	(_gl_isinff): Renamed from gl_isinff.
+	(_gl_isinfd): Renamed from gl_isinfd.
+	(_gl_isinfl): Renamed from gl_isinfl.
+	(_gl_isnanf): Renamed from gl_isnan_f.
+	(_gl_isnand): Renamed from gl_isnan_d.
+	(_gl_isnanl): Renamed from gl_isnan_l.
+	(_gl_signbitf): Renamed from gl_signbitf.
+	(_gl_signbitf_OPTIMIZED_MACRO): Renamed from
+	gl_signbitf_OPTIMIZED_MACRO.
+	(_gl_signbitd): Renamed from gl_signbitd.
+	(_gl_signbitd_OPTIMIZED_MACRO): Renamed from
+	gl_signbitd_OPTIMIZED_MACRO.
+	(_gl_signbitl): Renamed from gl_signbitl.
+	(_gl_signbitl_OPTIMIZED_MACRO): Renamed from
+	gl_signbitl_OPTIMIZED_MACRO.
+	* lib/isfinite.c: Update.
+	* lib/isinf.c: Update.
+	* lib/signbitf.c: Update.
+	* lib/signbitd.c: Update.
+	* lib/signbitl.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	float-h: Move private Gnulib data to _gl_* namespace.
diff --git a/lib/isfinite.c b/lib/isfinite.c
index 21857cfb2b..3c1dafb9b3 100644
--- a/lib/isfinite.c
+++ b/lib/isfinite.c
@@ -35,17 +35,17 @@ static long double zerol;
 # define zerol 0.L
 #endif
 
-int gl_isfinitef (float x)
+int _gl_isfinitef (float x)
 {
   return !isnanf (x) && x - x == zerof;
 }
 
-int gl_isfinited (double x)
+int _gl_isfinited (double x)
 {
   return !isnand (x) && x - x == zerod;
 }
 
-int gl_isfinitel (long double x)
+int _gl_isfinitel (long double x)
 {
   return !isnanl (x) && x - x == zerol;
 }
diff --git a/lib/isinf.c b/lib/isinf.c
index 227775c009..6fd3d92ce7 100644
--- a/lib/isinf.c
+++ b/lib/isinf.c
@@ -21,19 +21,19 @@
 #include <float.h>
 
 int
-gl_isinff (float x)
+_gl_isinff (float x)
 {
   return x < -FLT_MAX || x > FLT_MAX;
 }
 
 int
-gl_isinfd (double x)
+_gl_isinfd (double x)
 {
   return x < -DBL_MAX || x > DBL_MAX;
 }
 
 int
-gl_isinfl (long double x)
+_gl_isinfl (long double x)
 {
   return x < -LDBL_MAX || x > LDBL_MAX;
 }
diff --git a/lib/math.in.h b/lib/math.in.h
index 14218ea08c..216c203a60 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -2463,20 +2463,20 @@ _GL_CXXALIASWARN (yn);
 
 #if @GNULIB_ISFINITE@ || @GNULIB_ISFINITE_NO_CXX@
 # if @REPLACE_ISFINITE@
-_GL_EXTERN_C int gl_isfinitef (float x);
-_GL_EXTERN_C int gl_isfinited (double x);
-_GL_EXTERN_C int gl_isfinitel (long double x);
+_GL_EXTERN_C int _gl_isfinitef (float x);
+_GL_EXTERN_C int _gl_isfinited (double x);
+_GL_EXTERN_C int _gl_isfinitel (long double x);
 #  ifdef __cplusplus
 template <typename T> int isfinite (T);
-template <> inline int isfinite<float> (float x) { return gl_isfinitef (x); }
-template <> inline int isfinite<double> (double x) { return gl_isfinited (x); }
-template <> inline int isfinite<long double> (long double x) { return gl_isfinitel (x); }
+template <> inline int isfinite<float> (float x) { return _gl_isfinitef (x); }
+template <> inline int isfinite<double> (double x) { return _gl_isfinited (x); }
+template <> inline int isfinite<long double> (long double x) { return _gl_isfinitel (x); }
 #  else
 #   undef isfinite
 #   define isfinite(x) \
-      (sizeof (x) == sizeof (long double) ? gl_isfinitel (x) : \
-       sizeof (x) == sizeof (double) ? gl_isfinited (x) : \
-       gl_isfinitef (x))
+      (sizeof (x) == sizeof (long double) ? _gl_isfinitel (x) : \
+       sizeof (x) == sizeof (double) ? _gl_isfinited (x) : \
+       _gl_isfinitef (x))
 #  endif
 # endif
 # if @GNULIB_ISFINITE@ && defined __cplusplus
@@ -2505,20 +2505,20 @@ _GL_WARN_REAL_FLOATING_DECL (isfinite);
 
 #if @GNULIB_ISINF@ || @GNULIB_ISINF_NO_CXX@
 # if @REPLACE_ISINF@
-_GL_EXTERN_C int gl_isinff (float x);
-_GL_EXTERN_C int gl_isinfd (double x);
-_GL_EXTERN_C int gl_isinfl (long double x);
+_GL_EXTERN_C int _gl_isinff (float x);
+_GL_EXTERN_C int _gl_isinfd (double x);
+_GL_EXTERN_C int _gl_isinfl (long double x);
 #  ifdef __cplusplus
 template <typename T> int isinf (T);
-template <> inline int isinf<float> (float x) { return gl_isinff (x); }
-template <> inline int isinf<double> (double x) { return gl_isinfd (x); }
-template <> inline int isinf<long double> (long double x) { return gl_isinfl (x); }
+template <> inline int isinf<float> (float x) { return _gl_isinff (x); }
+template <> inline int isinf<double> (double x) { return _gl_isinfd (x); }
+template <> inline int isinf<long double> (long double x) { return _gl_isinfl (x); }
 #  else
 #   undef isinf
 #   define isinf(x) \
-      (sizeof (x) == sizeof (long double) ? gl_isinfl (x) : \
-       sizeof (x) == sizeof (double) ? gl_isinfd (x) : \
-       gl_isinff (x))
+      (sizeof (x) == sizeof (long double) ? _gl_isinfl (x) : \
+       sizeof (x) == sizeof (double) ? _gl_isinfd (x) : \
+       _gl_isinff (x))
 #  endif
 # endif
 # if @GNULIB_ISINF@ && defined __cplusplus
@@ -2632,35 +2632,35 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
    that recursively expand back to isnan.  So use the gnulib
    replacements for them directly. */
 #  if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
-#   define gl_isnan_f(x) __builtin_isnan ((float)(x))
+#   define _gl_isnanf(x) __builtin_isnan ((float)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanf (float x);
-#   define gl_isnan_f(x) rpl_isnanf (x)
+#   define _gl_isnanf(x) rpl_isnanf (x)
 #  endif
 #  if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
-#   define gl_isnan_d(x) __builtin_isnan ((double)(x))
+#   define _gl_isnand(x) __builtin_isnan ((double)(x))
 #  else
 _GL_EXTERN_C int rpl_isnand (double x);
-#   define gl_isnan_d(x) rpl_isnand (x)
+#   define _gl_isnand(x) rpl_isnand (x)
 #  endif
 #  if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
-#   define gl_isnan_l(x) __builtin_isnan ((long double)(x))
+#   define _gl_isnanl(x) __builtin_isnan ((long double)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
-#   define gl_isnan_l(x) rpl_isnanl (x)
+#   define _gl_isnanl(x) rpl_isnanl (x)
 #  endif
 #  ifdef __cplusplus
 #   undef isnan
 template <typename T> int isnan (T);
-template <> inline int isnan<float> (float x) { return gl_isnan_f (x); }
-template <> inline int isnan<double> (double x) { return gl_isnan_d (x); }
-template <> inline int isnan<long double> (long double x) { return gl_isnan_l (x); }
+template <> inline int isnan<float> (float x) { return _gl_isnanf (x); }
+template <> inline int isnan<double> (double x) { return _gl_isnand (x); }
+template <> inline int isnan<long double> (long double x) { return _gl_isnanl (x); }
 #  else
 #   undef isnan
 #   define isnan(x) \
-      (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
-       sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
-       gl_isnan_f (x))
+      (sizeof (x) == sizeof (long double) ? _gl_isnanl (x) : \
+       sizeof (x) == sizeof (double) ? _gl_isnand (x) : \
+       _gl_isnanf (x))
 #  endif
 # elif (__GNUC__ >= 4) || (__clang_major__ >= 4)
 #  ifdef __cplusplus
@@ -2730,15 +2730,15 @@ template <> inline int signbit<long double> (long double x) { return __builtin_s
 # endif
 # if @REPLACE_SIGNBIT@ && !GNULIB_defined_signbit
 #  undef signbit
-_GL_EXTERN_C int gl_signbitf (float arg);
-_GL_EXTERN_C int gl_signbitd (double arg);
-_GL_EXTERN_C int gl_signbitl (long double arg);
+_GL_EXTERN_C int _gl_signbitf (float arg);
+_GL_EXTERN_C int _gl_signbitd (double arg);
+_GL_EXTERN_C int _gl_signbitl (long double arg);
 #  if __GNUC__ >= 2 || defined __clang__
 #   define _GL_NUM_UINT_WORDS(type) \
       ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-#   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
-#    define gl_signbitf_OPTIMIZED_MACRO
-#    define gl_signbitf(arg) \
+#   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined _gl_signbitf
+#    define _gl_signbitf_OPTIMIZED_MACRO
+#    define _gl_signbitf(arg) \
        __extension__                                                    \
        ({ union { float _value;                                         \
                   unsigned int _word[_GL_NUM_UINT_WORDS (float)];       \
@@ -2747,9 +2747,9 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
           (_m._word[FLT_SIGNBIT_WORD] >> FLT_SIGNBIT_BIT) & 1;          \
         })
 #   endif
-#   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined gl_signbitd
-#    define gl_signbitd_OPTIMIZED_MACRO
-#    define gl_signbitd(arg) \
+#   if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT && !defined _gl_signbitd
+#    define _gl_signbitd_OPTIMIZED_MACRO
+#    define _gl_signbitd(arg) \
        __extension__                                                    \
        ({ union { double _value;                                        \
                   unsigned int _word[_GL_NUM_UINT_WORDS (double)];      \
@@ -2758,9 +2758,9 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
           (_m._word[DBL_SIGNBIT_WORD] >> DBL_SIGNBIT_BIT) & 1;          \
         })
 #   endif
-#   if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined gl_signbitl
-#    define gl_signbitl_OPTIMIZED_MACRO
-#    define gl_signbitl(arg) \
+#   if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT && !defined _gl_signbitl
+#    define _gl_signbitl_OPTIMIZED_MACRO
+#    define _gl_signbitl(arg) \
        __extension__                                                    \
        ({ union { long double _value;                                   \
                   unsigned int _word[_GL_NUM_UINT_WORDS (long double)]; \
@@ -2772,14 +2772,14 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
 #  endif
 #  if defined __cplusplus && !defined __clang__
 template <typename T> int signbit (T);
-template <> inline int signbit<float> (float x) { return gl_signbitf (x); }
-template <> inline int signbit<double> (double x) { return gl_signbitd (x); }
-template <> inline int signbit<long double> (long double x) { return gl_signbitl (x); }
+template <> inline int signbit<float> (float x) { return _gl_signbitf (x); }
+template <> inline int signbit<double> (double x) { return _gl_signbitd (x); }
+template <> inline int signbit<long double> (long double x) { return _gl_signbitl (x); }
 #  else
 #   define signbit(x) \
-      (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
-       sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
-       gl_signbitf (x))
+      (sizeof (x) == sizeof (long double) ? _gl_signbitl (x) : \
+       sizeof (x) == sizeof (double) ? _gl_signbitd (x) : \
+       _gl_signbitf (x))
 #  endif
 #  define GNULIB_defined_signbit 1
 # endif
diff --git a/lib/signbitd.c b/lib/signbitd.c
index 18b7c8fe77..b1bc7b97b0 100644
--- a/lib/signbitd.c
+++ b/lib/signbitd.c
@@ -23,12 +23,12 @@
 #include "isnand-nolibm.h"
 #include "float+.h"
 
-#ifdef gl_signbitd_OPTIMIZED_MACRO
-# undef gl_signbitd
+#ifdef _gl_signbitd_OPTIMIZED_MACRO
+# undef _gl_signbitd
 #endif
 
 int
-gl_signbitd (double arg)
+_gl_signbitd (double arg)
 {
 #if defined DBL_SIGNBIT_WORD && defined DBL_SIGNBIT_BIT
   /* The use of a union to extract the bits of the representation of a
diff --git a/lib/signbitf.c b/lib/signbitf.c
index a6c867b964..cf6fe0a383 100644
--- a/lib/signbitf.c
+++ b/lib/signbitf.c
@@ -23,12 +23,12 @@
 #include "isnanf-nolibm.h"
 #include "float+.h"
 
-#ifdef gl_signbitf_OPTIMIZED_MACRO
-# undef gl_signbitf
+#ifdef _gl_signbitf_OPTIMIZED_MACRO
+# undef _gl_signbitf
 #endif
 
 int
-gl_signbitf (float arg)
+_gl_signbitf (float arg)
 {
 #if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT
   /* The use of a union to extract the bits of the representation of a
diff --git a/lib/signbitl.c b/lib/signbitl.c
index 16ab0c6154..65460be540 100644
--- a/lib/signbitl.c
+++ b/lib/signbitl.c
@@ -23,12 +23,12 @@
 #include "isnanl-nolibm.h"
 #include "float+.h"
 
-#ifdef gl_signbitl_OPTIMIZED_MACRO
-# undef gl_signbitl
+#ifdef _gl_signbitl_OPTIMIZED_MACRO
+# undef _gl_signbitl
 #endif
 
 int
-gl_signbitl (long double arg)
+_gl_signbitl (long double arg)
 {
 #if defined LDBL_SIGNBIT_WORD && defined LDBL_SIGNBIT_BIT
   /* The use of a union to extract the bits of the representation of a
-- 
2.52.0

>From 554699d6eeebd3c0a324cf975eab2074045a955b Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:38:32 +0100
Subject: [PATCH 08/12] stdio-h, stdio-windows: Move private Gnulib functions
 to _gl_* namespace.

* lib/stdio.in.h (_gl_consolesafe_fwrite): Renamed from
gl_consolesafe_fwrite.
(_gl_consolesafe_fprintf): Renamed from gl_consolesafe_fprintf.
(_gl_consolesafe_printf): Renamed from gl_consolesafe_printf.
(_gl_consolesafe_vfprintf): Renamed from gl_consolesafe_vfprintf.
(_gl_consolesafe_vprintf): Renamed from gl_consolesafe_vprintf.
* lib/stdio-consolesafe.c: Update.
* lib/stdio-write.c: Update.
---
 ChangeLog               | 12 ++++++++++++
 lib/stdio-consolesafe.c | 12 ++++++------
 lib/stdio-write.c       |  4 ++--
 lib/stdio.in.h          | 20 ++++++++++----------
 4 files changed, 30 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 73ca1c4c77..dd11e035c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	stdio-h, stdio-windows: Move private Gnulib functions to _gl_* namespace.
+	* lib/stdio.in.h (_gl_consolesafe_fwrite): Renamed from
+	gl_consolesafe_fwrite.
+	(_gl_consolesafe_fprintf): Renamed from gl_consolesafe_fprintf.
+	(_gl_consolesafe_printf): Renamed from gl_consolesafe_printf.
+	(_gl_consolesafe_vfprintf): Renamed from gl_consolesafe_vfprintf.
+	(_gl_consolesafe_vprintf): Renamed from gl_consolesafe_vprintf.
+	* lib/stdio-consolesafe.c: Update.
+	* lib/stdio-write.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	math-h: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/stdio-consolesafe.c b/lib/stdio-consolesafe.c
index f634de13ef..3d913d555e 100644
--- a/lib/stdio-consolesafe.c
+++ b/lib/stdio-consolesafe.c
@@ -56,7 +56,7 @@ workaround_fwrite0 (char *s, size_t n, FILE *fp)
 }
 
 size_t
-gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp)
+_gl_consolesafe_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *fp)
 {
   size_t nbytes;
   if (ckd_mul (&nbytes, size, nmemb) || nbytes == 0)
@@ -133,7 +133,7 @@ local_vasprintf (char **resultp, const char *format, va_list args)
    __mingw_*printf.  */
 
 int
-gl_consolesafe_fprintf (FILE *restrict fp, const char *restrict format, ...)
+_gl_consolesafe_fprintf (FILE *restrict fp, const char *restrict format, ...)
 {
   va_list args;
   va_start (args, format);
@@ -151,7 +151,7 @@ gl_consolesafe_fprintf (FILE *restrict fp, const char *restrict format, ...)
 }
 
 int
-gl_consolesafe_printf (const char *restrict format, ...)
+_gl_consolesafe_printf (const char *restrict format, ...)
 {
   va_list args;
   va_start (args, format);
@@ -169,8 +169,8 @@ gl_consolesafe_printf (const char *restrict format, ...)
 }
 
 int
-gl_consolesafe_vfprintf (FILE *restrict fp,
-                         const char *restrict format, va_list args)
+_gl_consolesafe_vfprintf (FILE *restrict fp,
+                          const char *restrict format, va_list args)
 {
   char *tmpstring;
   int result = vasprintf (&tmpstring, format, args);
@@ -185,7 +185,7 @@ gl_consolesafe_vfprintf (FILE *restrict fp,
 }
 
 int
-gl_consolesafe_vprintf (const char *restrict format, va_list args)
+_gl_consolesafe_vprintf (const char *restrict format, va_list args)
 {
   char *tmpstring;
   int result = vasprintf (&tmpstring, format, args);
diff --git a/lib/stdio-write.c b/lib/stdio-write.c
index fc7f74fefa..c33b550dd6 100644
--- a/lib/stdio-write.c
+++ b/lib/stdio-write.c
@@ -158,7 +158,7 @@ int
 vfprintf (FILE *stream, const char *format, va_list args)
 #undef vfprintf
 #if defined __MINGW32__ && !defined _UCRT && __USE_MINGW_ANSI_STDIO
-# define vfprintf gl_consolesafe_vfprintf
+# define vfprintf _gl_consolesafe_vfprintf
 #endif
 {
   CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
@@ -197,7 +197,7 @@ size_t
 fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
 #undef fwrite
 #if (defined _WIN32 && !defined __CYGWIN__) && !defined _UCRT
-# define fwrite gl_consolesafe_fwrite
+# define fwrite _gl_consolesafe_fwrite
 #endif
 {
   CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index 4028bfa4fa..107ebd6df1 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -331,24 +331,24 @@ _GL_EXTERN_C void free (void *);
 
 #if (defined _WIN32 && !defined __CYGWIN__) && !defined _UCRT
 /* Workarounds against msvcrt bugs.  */
-_GL_FUNCDECL_SYS (gl_consolesafe_fwrite, size_t,
+_GL_FUNCDECL_SYS (_gl_consolesafe_fwrite, size_t,
                   (const void *ptr, size_t size, size_t nmemb, FILE *fp),
                   _GL_ARG_NONNULL ((1, 4)));
 # if defined __MINGW32__
-_GL_FUNCDECL_SYS (gl_consolesafe_fprintf, int,
+_GL_FUNCDECL_SYS (_gl_consolesafe_fprintf, int,
                   (FILE *restrict fp, const char *restrict format, ...),
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_FUNCDECL_SYS (gl_consolesafe_printf, int,
+_GL_FUNCDECL_SYS (_gl_consolesafe_printf, int,
                   (const char *restrict format, ...),
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
                   _GL_ARG_NONNULL ((1)));
-_GL_FUNCDECL_SYS (gl_consolesafe_vfprintf, int,
+_GL_FUNCDECL_SYS (_gl_consolesafe_vfprintf, int,
                   (FILE *restrict fp,
                    const char *restrict format, va_list args),
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
-_GL_FUNCDECL_SYS (gl_consolesafe_vprintf, int,
+_GL_FUNCDECL_SYS (_gl_consolesafe_vprintf, int,
                   (const char *restrict format, va_list args),
                   _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
                   _GL_ARG_NONNULL ((1)));
@@ -691,7 +691,7 @@ _GL_CXXALIASWARN (fprintf);
 #elif defined __MINGW32__ && !defined _UCRT && __USE_MINGW_ANSI_STDIO
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef fprintf
-#  define fprintf gl_consolesafe_fprintf
+#  define fprintf _gl_consolesafe_fprintf
 # endif
 #endif
 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
@@ -1043,7 +1043,7 @@ _GL_CXXALIASWARN (fwrite);
 #elif (defined _WIN32 && !defined __CYGWIN__) && !defined _UCRT
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef fwrite
-#  define fwrite gl_consolesafe_fwrite
+#  define fwrite _gl_consolesafe_fwrite
 # endif
 #endif
 
@@ -1429,7 +1429,7 @@ _GL_CXXALIASWARN (printf);
 #elif defined __MINGW32__ && !defined _UCRT && __USE_MINGW_ANSI_STDIO
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef printf
-#  define printf gl_consolesafe_printf
+#  define printf _gl_consolesafe_printf
 # endif
 #endif
 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
@@ -1996,7 +1996,7 @@ _GL_CXXALIASWARN (vfprintf);
 #elif defined __MINGW32__ && !defined _UCRT && __USE_MINGW_ANSI_STDIO
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef vfprintf
-#  define vfprintf gl_consolesafe_vfprintf
+#  define vfprintf _gl_consolesafe_vfprintf
 # endif
 #endif
 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
@@ -2079,7 +2079,7 @@ _GL_CXXALIASWARN (vprintf);
 #elif defined __MINGW32__ && !defined _UCRT && __USE_MINGW_ANSI_STDIO
 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  undef vprintf
-#  define vprintf gl_consolesafe_vprintf
+#  define vprintf _gl_consolesafe_vprintf
 # endif
 #endif
 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
-- 
2.52.0

>From a3d7e0ea581bc3133cdda70eb511049331aa4616 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:41:06 +0100
Subject: [PATCH 09/12] stdlib-h: Move private Gnulib functions to _gl_*
 namespace.

* lib/stdlib.in.h (_gl_MB_CUR_MAX): Renamed from gl_MB_CUR_MAX.
---
 ChangeLog       | 5 +++++
 lib/stdlib.in.h | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dd11e035c1..d26dcf5773 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	stdlib-h: Move private Gnulib functions to _gl_* namespace.
+	* lib/stdlib.in.h (_gl_MB_CUR_MAX): Renamed from gl_MB_CUR_MAX.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	stdio-h, stdio-windows: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h
index 95237f2a5c..ed2b1f8ff2 100644
--- a/lib/stdlib.in.h
+++ b/lib/stdlib.in.h
@@ -757,7 +757,7 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
 #if @REPLACE_MB_CUR_MAX@
 # if !GNULIB_defined_MB_CUR_MAX
 _GL_STDLIB_INLINE size_t
-gl_MB_CUR_MAX (void)
+_gl_MB_CUR_MAX (void)
 {
 #  if 0 < @REPLACE_MB_CUR_MAX@
   return @REPLACE_MB_CUR_MAX@;
@@ -768,7 +768,7 @@ gl_MB_CUR_MAX (void)
 #  endif
 }
 #  undef MB_CUR_MAX
-#  define MB_CUR_MAX gl_MB_CUR_MAX ()
+#  define MB_CUR_MAX _gl_MB_CUR_MAX ()
 #  define GNULIB_defined_MB_CUR_MAX 1
 # endif
 #endif
-- 
2.52.0

>From 35bc91bb912dc5085db564d90b122a27362dbc3b Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:43:30 +0100
Subject: [PATCH 10/12] strnul: Move private Gnulib functions to _gl_*
 namespace.

* lib/string.in.h (_gl_strnul): Renamed from gl_strnul.
* lib/strnul.c: Update.
---
 ChangeLog       |  6 ++++++
 lib/string.in.h | 14 +++++++-------
 lib/strnul.c    |  2 +-
 3 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d26dcf5773..785a5cc3fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	strnul: Move private Gnulib functions to _gl_* namespace.
+	* lib/string.in.h (_gl_strnul): Renamed from gl_strnul.
+	* lib/strnul.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	stdlib-h: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/string.in.h b/lib/string.in.h
index 0cd83c7844..93614de91f 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1248,10 +1248,10 @@ _GL_WARN_ON_USE (strtok_r, "strtok_r is unportable - "
 # ifdef __cplusplus
 extern "C" {
 # endif
-_GL_STRNUL_INLINE const char *gl_strnul (const char *string)
+_GL_STRNUL_INLINE const char *_gl_strnul (const char *string)
      _GL_ATTRIBUTE_PURE
      _GL_ARG_NONNULL ((1));
-_GL_STRNUL_INLINE const char *gl_strnul (const char *string)
+_GL_STRNUL_INLINE const char *_gl_strnul (const char *string)
 {
   /* In gcc >= 7 or clang >= 4, we could use the expression
        strchr (string, '\0')
@@ -1268,9 +1268,9 @@ _GL_STRNUL_INLINE const char *gl_strnul (const char *string)
 _GL_BEGIN_NAMESPACE
 template <typename T> T strnul (T);
 template <> inline const char *strnul<const char *> (const char *s)
-{ return gl_strnul (s); }
+{ return _gl_strnul (s); }
 template <> inline       char *strnul<      char *> (      char *s)
-{ return const_cast<char *>(gl_strnul (s)); }
+{ return const_cast<char *>(_gl_strnul (s)); }
 _GL_END_NAMESPACE
 # else
 #  if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 9) > 4 && !defined __cplusplus) \
@@ -1286,11 +1286,11 @@ _GL_END_NAMESPACE
    This mapping is done through the conditional expression.  */
 #   define strnul(s) \
       _Generic (1 ? (s) : (void *) 99, \
-                void *       : (char *) gl_strnul (s), \
-                const void * : gl_strnul (s))
+                void *       : (char *) _gl_strnul (s), \
+                const void * : _gl_strnul (s))
 #  else
 #   define strnul(s) \
-      ((char *) gl_strnul (s))
+      ((char *) _gl_strnul (s))
 #  endif
 # endif
 #endif
diff --git a/lib/strnul.c b/lib/strnul.c
index a567f0722e..e825542e55 100644
--- a/lib/strnul.c
+++ b/lib/strnul.c
@@ -1,4 +1,4 @@
-/* gl_strnul function.
+/* _gl_strnul function.
    Copyright (C) 2025-2026 Free Software Foundation, Inc.
 
    This file is free software: you can redistribute it and/or modify
-- 
2.52.0

>From 4157f0460f70891a2ca1374a55f7e4e8772bd2f7 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:55:10 +0100
Subject: [PATCH 11/12] locale-h: Move private Gnulib functions to _gl_*
 namespace.

* lib/locale.in.h (_gl_log2_lc_mask): Renamed from gl_log2_lc_mask.
(_gl_log2_lcmask_to_index): Renamed from gl_log2_lcmask_to_index.
(_gl_index_to_log2_lcmask): Renamed from gl_index_to_log2_lcmask.
* lib/duplocale.c: Update.
* lib/freelocale.c: Update.
* lib/newlocale.c: Update.
* lib/getlocalename_l-unsafe.c: Update.
* lib/is_l-impl.h: Update.
* lib/to_l-impl.h: Update.
* lib/strcasecmp_l.c: Update.
* lib/strncasecmp_l.c: Update.
* lib/strerror_l.c: Update.
---
 ChangeLog                    | 16 ++++++++++++++++
 lib/duplocale.c              |  6 +++---
 lib/freelocale.c             |  2 +-
 lib/getlocalename_l-unsafe.c |  2 +-
 lib/is_l-impl.h              |  2 +-
 lib/locale.in.h              | 32 ++++++++++++++++----------------
 lib/newlocale.c              | 22 +++++++++++-----------
 lib/strcasecmp_l.c           |  2 +-
 lib/strerror_l.c             |  2 +-
 lib/strncasecmp_l.c          |  2 +-
 lib/to_l-impl.h              |  2 +-
 11 files changed, 53 insertions(+), 37 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 785a5cc3fc..a760045a9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	locale-h: Move private Gnulib functions to _gl_* namespace.
+	* lib/locale.in.h (_gl_log2_lc_mask): Renamed from gl_log2_lc_mask.
+	(_gl_log2_lcmask_to_index): Renamed from gl_log2_lcmask_to_index.
+	(_gl_index_to_log2_lcmask): Renamed from gl_index_to_log2_lcmask.
+	* lib/duplocale.c: Update.
+	* lib/freelocale.c: Update.
+	* lib/newlocale.c: Update.
+	* lib/getlocalename_l-unsafe.c: Update.
+	* lib/is_l-impl.h: Update.
+	* lib/to_l-impl.h: Update.
+	* lib/strcasecmp_l.c: Update.
+	* lib/strncasecmp_l.c: Update.
+	* lib/strerror_l.c: Update.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	strnul: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/duplocale.c b/lib/duplocale.c
index 679dd58cd7..8889ef263a 100644
--- a/lib/duplocale.c
+++ b/lib/duplocale.c
@@ -125,7 +125,7 @@ duplocale (locale_t locale)
 
   for (int i = 0; i < 6; i++)
     {
-      int log2_lcmask = gl_index_to_log2_lcmask (i);
+      int log2_lcmask = _gl_index_to_log2_lcmask (i);
       int err;
 
       result->category[i].name = strdup (locale->category[i].name);
@@ -136,7 +136,7 @@ duplocale (locale_t locale)
         }
       result->category[i].is_c_locale = locale->category[i].is_c_locale;
 # if HAVE_WINDOWS_LOCALE_T
-      if (log2_lcmask == gl_log2_lc_mask (LC_MESSAGES)
+      if (log2_lcmask == _gl_log2_lc_mask (LC_MESSAGES)
           || result->category[i].is_c_locale)
         {
           /* Just to initialize it.  */
@@ -165,7 +165,7 @@ duplocale (locale_t locale)
           while (--i >= 0)
             {
 # if HAVE_WINDOWS_LOCALE_T
-              if (!(i == gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))
+              if (!(i == _gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))
                     || result->category[i].is_c_locale))
                 /* Documentation:
                    <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/free-locale>  */
diff --git a/lib/freelocale.c b/lib/freelocale.c
index f9f0ccf926..9d8bb90d32 100644
--- a/lib/freelocale.c
+++ b/lib/freelocale.c
@@ -29,7 +29,7 @@ freelocale (locale_t locale)
   for (int i = 6; --i >= 0; )
     {
 #if HAVE_WINDOWS_LOCALE_T
-      if (!(i == gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))
+      if (!(i == _gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))
             || locale->category[i].is_c_locale))
         /* Documentation:
            <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/free-locale>  */
diff --git a/lib/getlocalename_l-unsafe.c b/lib/getlocalename_l-unsafe.c
index 665e6d62fa..cac2f35b62 100644
--- a/lib/getlocalename_l-unsafe.c
+++ b/lib/getlocalename_l-unsafe.c
@@ -452,7 +452,7 @@ getlocalename_l_unsafe (int category, locale_t locale)
     {
 #if GNULIB_defined_locale_t
       struct gl_locale_category_t *plc =
-        &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (category))];
+        &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (category))];
       return (struct string_with_storage) { plc->name, STORAGE_OBJECT };
 #elif __GLIBC__ >= 2 && !defined __UCLIBC__
       /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
diff --git a/lib/is_l-impl.h b/lib/is_l-impl.h
index b31787d6e3..aa17b13523 100644
--- a/lib/is_l-impl.h
+++ b/lib/is_l-impl.h
@@ -23,7 +23,7 @@ int
 FUNC (int c, locale_t locale)
 {
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
+    &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return C_FUNC (c);
diff --git a/lib/locale.in.h b/lib/locale.in.h
index c264493e65..e529111e48 100644
--- a/lib/locale.in.h
+++ b/lib/locale.in.h
@@ -88,38 +88,38 @@
    category            1        2           6         3            4        5
    log2(LC_*_MASK)     0        1           2         3            4        5
  */
-#   define gl_log2_lc_mask(category) ((0x2543100 >> (4 * (category))) & 0xf)
+#   define _gl_log2_lc_mask(category) ((0x2543100 >> (4 * (category))) & 0xf)
 #  elif defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */
 /*                LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
 
    category            1        2           6         3            4        5
    log2(LC_*_MASK)     0        1           5         2            3        4
  */
-#   define gl_log2_lc_mask(category) ((category) - 1)
+#   define _gl_log2_lc_mask(category) ((category) - 1)
 #  elif defined _WIN32 && !defined __CYGWIN__        /* native Windows */
-#   define gl_log2_lc_mask(category) \
+#   define _gl_log2_lc_mask(category) \
       ((category) == LC_MESSAGES ? 0 : (category))
 #  else                           /* glibc, Solaris, Android, NetBSD, OpenBSD */
-#   define gl_log2_lc_mask(category) (category)
+#   define _gl_log2_lc_mask(category) (category)
 #  endif
 /* From there we map them to array indices 0..5.  */
-#  if (gl_log2_lc_mask (LC_COLLATE) == 0 || gl_log2_lc_mask (LC_CTYPE) == 0 \
-       || gl_log2_lc_mask (LC_MESSAGES) == 0)
+#  if (_gl_log2_lc_mask (LC_COLLATE) == 0 || _gl_log2_lc_mask (LC_CTYPE) == 0 \
+       || _gl_log2_lc_mask (LC_MESSAGES) == 0)
   /* glibc, Solaris, Android, macOS, FreeBSD, native Windows */
-#   define gl_log2_lcmask_to_index(c) (c)
-#   define gl_index_to_log2_lcmask(i) (i)
+#   define _gl_log2_lcmask_to_index(c) (c)
+#   define _gl_index_to_log2_lcmask(i) (i)
 #  else
   /* NetBSD, OpenBSD */
-#   define gl_log2_lcmask_to_index(c) ((c) - 1)
-#   define gl_index_to_log2_lcmask(i) ((i) + 1)
+#   define _gl_log2_lcmask_to_index(c) ((c) - 1)
+#   define _gl_index_to_log2_lcmask(i) ((i) + 1)
 #  endif
 /* Define the LC_*_MASK macros.  */
-#  define LC_COLLATE_MASK  (1 << gl_log2_lc_mask (LC_COLLATE))
-#  define LC_CTYPE_MASK    (1 << gl_log2_lc_mask (LC_CTYPE))
-#  define LC_MESSAGES_MASK (1 << gl_log2_lc_mask (LC_MESSAGES))
-#  define LC_MONETARY_MASK (1 << gl_log2_lc_mask (LC_MONETARY))
-#  define LC_NUMERIC_MASK  (1 << gl_log2_lc_mask (LC_NUMERIC))
-#  define LC_TIME_MASK     (1 << gl_log2_lc_mask (LC_TIME))
+#  define LC_COLLATE_MASK  (1 << _gl_log2_lc_mask (LC_COLLATE))
+#  define LC_CTYPE_MASK    (1 << _gl_log2_lc_mask (LC_CTYPE))
+#  define LC_MESSAGES_MASK (1 << _gl_log2_lc_mask (LC_MESSAGES))
+#  define LC_MONETARY_MASK (1 << _gl_log2_lc_mask (LC_MONETARY))
+#  define LC_NUMERIC_MASK  (1 << _gl_log2_lc_mask (LC_NUMERIC))
+#  define LC_TIME_MASK     (1 << _gl_log2_lc_mask (LC_TIME))
 #  define LC_ALL_MASK \
      (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | LC_MONETARY_MASK \
       | LC_NUMERIC_MASK | LC_TIME_MASK)
diff --git a/lib/newlocale.c b/lib/newlocale.c
index efedbc7181..22e2bb2092 100644
--- a/lib/newlocale.c
+++ b/lib/newlocale.c
@@ -126,7 +126,7 @@ newlocale (int category_mask, const char *name, locale_t base)
   int err;
   for (int i = 0; i < 6; i++)
     {
-      int log2_lcmask = gl_index_to_log2_lcmask (i);
+      int log2_lcmask = _gl_index_to_log2_lcmask (i);
 
       if ((category_mask & (1 << log2_lcmask)) != 0)
         {
@@ -136,17 +136,17 @@ newlocale (int category_mask, const char *name, locale_t base)
               /* name == "" means to look at the environment variables.  */
               static struct { int cat; char cat_name[11 + 1]; } const categories[6] =
                 {
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_COLLATE))]  =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_COLLATE))]  =
                     { LC_COLLATE,  "LC_COLLATE" },
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))]    =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_CTYPE))]    =
                     { LC_CTYPE,    "LC_CTYPE" },
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))] =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))] =
                     { LC_MESSAGES, "LC_MESSAGES" },
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MONETARY))] =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MONETARY))] =
                     { LC_MONETARY, "LC_MONETARY" },
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_NUMERIC))]  =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_NUMERIC))]  =
                     { LC_NUMERIC,  "LC_NUMERIC" },
-                  [gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_TIME))]     =
+                  [_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_TIME))]     =
                     { LC_TIME,     "LC_TIME" }
                 };
               lcname = gl_locale_name_environ (categories[i].cat,
@@ -175,7 +175,7 @@ newlocale (int category_mask, const char *name, locale_t base)
             {
               result->category[i].is_c_locale = false;
 # if HAVE_WINDOWS_LOCALE_T
-              if (log2_lcmask == gl_log2_lc_mask (LC_MESSAGES))
+              if (log2_lcmask == _gl_log2_lc_mask (LC_MESSAGES))
                 result->category[i].system_locale = NULL;
               else
                 {
@@ -219,7 +219,7 @@ newlocale (int category_mask, const char *name, locale_t base)
           while (--i >= 0)
             {
 # if HAVE_WINDOWS_LOCALE_T
-              if (!(i == gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))
+              if (!(i == _gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))
                     || result->category[i].is_c_locale))
                 /* Documentation:
                    <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/free-locale>  */
@@ -240,11 +240,11 @@ newlocale (int category_mask, const char *name, locale_t base)
       /* Copy the modified entries from RESULT to BASE.  */
       for (int i = 0; i < 6; i++)
         {
-          int log2_lcmask = gl_index_to_log2_lcmask (i);
+          int log2_lcmask = _gl_index_to_log2_lcmask (i);
           if ((category_mask & (1 << log2_lcmask)) != 0)
             {
 # if HAVE_WINDOWS_LOCALE_T
-              if (!(i == gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))
+              if (!(i == _gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))
                     || base->category[i].is_c_locale))
                 /* Documentation:
                    <https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/free-locale>  */
diff --git a/lib/strcasecmp_l.c b/lib/strcasecmp_l.c
index 7a7ce1c0b2..504bc99936 100644
--- a/lib/strcasecmp_l.c
+++ b/lib/strcasecmp_l.c
@@ -31,7 +31,7 @@ strcasecmp_l (const char *s1, const char *s2, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
+    &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return c_strcasecmp (s1, s2);
diff --git a/lib/strerror_l.c b/lib/strerror_l.c
index 921ef17370..a3578120c4 100644
--- a/lib/strerror_l.c
+++ b/lib/strerror_l.c
@@ -120,7 +120,7 @@ strerror_l_r (int errnum, char *buf, size_t buflen, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_MESSAGES))];
+    &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_MESSAGES))];
   if (plc->is_c_locale)
     {
       /* Implementation for the "C" locale.  */
diff --git a/lib/strncasecmp_l.c b/lib/strncasecmp_l.c
index 56d1e7ac96..4956365d32 100644
--- a/lib/strncasecmp_l.c
+++ b/lib/strncasecmp_l.c
@@ -31,7 +31,7 @@ strncasecmp_l (const char *s1, const char *s2, size_t n, locale_t locale)
 #if GNULIB_defined_locale_t
 
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
+    &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return c_strncasecmp (s1, s2, n);
diff --git a/lib/to_l-impl.h b/lib/to_l-impl.h
index ba7805f983..2744cc6262 100644
--- a/lib/to_l-impl.h
+++ b/lib/to_l-impl.h
@@ -23,7 +23,7 @@ int
 FUNC (int c, locale_t locale)
 {
   struct gl_locale_category_t *plc =
-    &locale->category[gl_log2_lcmask_to_index (gl_log2_lc_mask (LC_CTYPE))];
+    &locale->category[_gl_log2_lcmask_to_index (_gl_log2_lc_mask (LC_CTYPE))];
   if (plc->is_c_locale)
     /* Implementation for the "C" locale.  */
     return C_FUNC (c);
-- 
2.52.0

>From 77111df233a962765d91fa2fef46e6ec95b496e6 Mon Sep 17 00:00:00 2001
From: Bruno Haible <[email protected]>
Date: Sun, 15 Mar 2026 21:58:34 +0100
Subject: [PATCH 12/12] posix_spawn-internal: Move private Gnulib functions to
 _gl_* namespace.

* lib/spawn_int.h (_gl_posix_spawn_file_actions_realloc): Renamed from
gl_posix_spawn_file_actions_realloc.
(_gl_posix_spawn_internal): Renamed from gl_posix_spawn_internal.
---
 ChangeLog       | 7 +++++++
 lib/spawn_int.h | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a760045a9b..3a767cd2e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2026-03-15  Bruno Haible  <[email protected]>
+
+	posix_spawn-internal: Move private Gnulib functions to _gl_* namespace.
+	* lib/spawn_int.h (_gl_posix_spawn_file_actions_realloc): Renamed from
+	gl_posix_spawn_file_actions_realloc.
+	(_gl_posix_spawn_internal): Renamed from gl_posix_spawn_internal.
+
 2026-03-15  Bruno Haible  <[email protected]>
 
 	locale-h: Move private Gnulib functions to _gl_* namespace.
diff --git a/lib/spawn_int.h b/lib/spawn_int.h
index 335656a019..f2720184f9 100644
--- a/lib/spawn_int.h
+++ b/lib/spawn_int.h
@@ -58,13 +58,13 @@ struct __spawn_action
 };
 
 #if !_LIBC
-# define __posix_spawn_file_actions_realloc gl_posix_spawn_file_actions_realloc
+# define __posix_spawn_file_actions_realloc _gl_posix_spawn_file_actions_realloc
 #endif
 extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
                                                file_actions);
 
 #if !_LIBC
-# define __spawni gl_posix_spawn_internal
+# define __spawni _gl_posix_spawn_internal
 #endif
 extern int __spawni (pid_t *pid, const char *path,
                      const posix_spawn_file_actions_t *file_actions,
-- 
2.52.0

Reply via email to