From: Paul Eggert Date: Sat, 13 Sep 2025 20:01:00 +0000 (-0700) Subject: endian: port to Solaris 11.4 and macOS 15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=226b0092dcbc4fd0c775057ddac0d31a444dad82;p=thirdparty%2Fgnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index b0758ac62a..f53d4204fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2025-09-13 Paul Eggert + + 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 gettext-h: Move fallback definition of GNULIB_TEXT_DOMAIN. diff --git a/lib/byteswap.in.h b/lib/byteswap.in.h index 1227f01d14..6b4fbabf28 100644 --- a/lib/byteswap.in.h +++ b/lib/byteswap.in.h @@ -23,13 +23,16 @@ #error "Please include config.h first." #endif -#include - -_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 + +_GL_INLINE_HEADER_BEGIN + #ifdef __cplusplus extern "C" { #endif diff --git a/lib/endian.in.h b/lib/endian.in.h index c07aa612f0..03f541967f 100644 --- a/lib/endian.in.h +++ b/lib/endian.in.h @@ -112,10 +112,10 @@ extern "C" { /* 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. */