+2025-09-13 Paul Eggert <eggert@cs.ucla.edu>
+
+ endian: port to Solaris 11.4 and macOS 15
+ Problem reported by Bruno Haible in:
+ https://lists.gnu.org/r/bug-gnulib/2025-09/msg00174.html
+ * lib/byteswap.in.h (_GL_BYTESWAP_INLINE):
+ Define before including stdint.h.
+ * lib/endian.in.h (bswap_16, bswap_32, bswap_64):
+ Declare as _GL_BYTESWAP_INLINE rather than as extern.
+ Conditionalize these decls with _GL_BYTESWAP_INLINE rather than
+ with _GL_BYTESWAP_H.
+
2025-09-13 Bruno Haible <bruno@clisp.org>
gettext-h: Move fallback definition of GNULIB_TEXT_DOMAIN.
#error "Please include config.h first."
#endif
-#include <stdint.h>
-
-_GL_INLINE_HEADER_BEGIN
+/* Define this now, rather than after including stdint.h, in case
+ stdint.h recursively includes us. This is for Gnulib endian.h. */
#ifndef _GL_BYTESWAP_INLINE
# define _GL_BYTESWAP_INLINE _GL_INLINE
#endif
+#include <stdint.h>
+
+_GL_INLINE_HEADER_BEGIN
+
#ifdef __cplusplus
extern "C" {
#endif
/* These declarations are needed if Gnulib byteswap.h -> stdint.h ->
sys/types.h -> endian.h -> Gnulib byteswap.h, the last of which is blocked
by its include guard so the functions are not yet declared. */
-#ifdef _GL_BYTESWAP_H
-extern uint_least16_t bswap_16 (uint_least16_t);
-extern uint_least32_t bswap_32 (uint_least32_t);
-extern uint_least64_t bswap_64 (uint_least64_t);
+#ifdef _GL_BYTESWAP_INLINE
+_GL_BYTESWAP_INLINE uint_least16_t bswap_16 (uint_least16_t);
+_GL_BYTESWAP_INLINE uint_least32_t bswap_32 (uint_least32_t);
+_GL_BYTESWAP_INLINE uint_least64_t bswap_64 (uint_least64_t);
#endif
/* Big endian to host. */