* lib/stdbit.in.h: Include <stddef.h> only if the stdc_memreverse8
module is also used, since it’s the only one that needs size_t.
Define __need_size_t before including <stddef.h>, so that <stddef.h>
defines only size_t on GNU platforms.
2026-04-29 Paul Eggert <eggert@cs.ucla.edu>
+ stdbit-h: <stddef.h> namespace cleanup
+ * lib/stdbit.in.h: Include <stddef.h> only if the stdc_memreverse8
+ module is also used, since it’s the only one that needs size_t.
+ Define __need_size_t before including <stddef.h>, so that <stddef.h>
+ defines only size_t on GNU platforms.
+
stdbit-h: include <stdint.h> only on module req
This is another attempt to tighten up the <stdbit.h> namespace
on GNU platforms, and follows up on previous C++ fixes here.
#error "Please include config.h first."
#endif
-#if (!@HAVE_STDBIT_H@ || @GNULIB_STDC_MEMREVERSE8@ \
- || (defined __cplusplus && defined __INTEL_CLANG_COMPILER))
-/* Get size_t. */
+/* If needed for APIs, get size_t, avoiding namespace pollution on GNU. */
+#if (@GNULIB_STDC_MEMREVERSE8@ \
+ && (!@HAVE_STDBIT_H@ \
+ || (defined __cplusplus && defined __INTEL_CLANG_COMPILER)))
+# define __need_size_t
# include <stddef.h>
#endif