On 2025-09-11 12:41, Orgad Shaneh wrote:
It looks like the exact same diff. Have you changed anything?

If you meant to remove the second condition (_GL_BYTESWAP_INLINE) then it
works.

Yes, sorry, that's what I meant. Thanks for checking. I installed the attached into Gnulib and it should appear in the next gzip release.
From 875d0f9b03a1e0fd55c88b2488a9b36945e85868 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Thu, 11 Sep 2025 12:49:07 -0700
Subject: [PATCH] endian: port to gcc 4.1 + glibc 2.4

Problem reported by Orgad Shaneh in:
https://lists.gnu.org/r/bug-gnulib/2025-09/msg00128.html
* lib/endian.in.h (bswap_16, bswap_32, bswap_64) [_GL_BYTESWAP_H]:
Declare before using.
---
 ChangeLog       | 8 ++++++++
 lib/endian.in.h | 9 +++++++++
 2 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 235fc24012..65f0bd42f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-09-11  Paul Eggert  <[email protected]>
+
+	endian: port to gcc 4.1 + glibc 2.4
+	Problem reported by Orgad Shaneh in:
+	https://lists.gnu.org/r/bug-gnulib/2025-09/msg00128.html
+	* lib/endian.in.h (bswap_16, bswap_32, bswap_64) [_GL_BYTESWAP_H]:
+	Declare before using.
+
 2025-09-11  Bruno Haible  <[email protected]>
 
 	pagealign_alloc: Add benchmark for comparing different implementations.
diff --git a/lib/endian.in.h b/lib/endian.in.h
index e81aa7da8c..c07aa612f0 100644
--- a/lib/endian.in.h
+++ b/lib/endian.in.h
@@ -109,6 +109,15 @@ _GL_INLINE_HEADER_BEGIN
 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);
+#endif
+
 /* Big endian to host.  */
 
 _GL_ENDIAN_INLINE uint16_t
-- 
2.48.1

Reply via email to