This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] byteswap.h: fix gcc ver test for __builtin_bswap32
- From: Mike Frysinger <vapier at gentoo dot org>
- To: libc-alpha at sourceware dot org
- Date: Wed, 28 Nov 2012 23:07:23 -0500
- Subject: [PATCH] byteswap.h: fix gcc ver test for __builtin_bswap32
The __builtin_bswap32 function was introduced in gcc-4.3, not gcc-4.2.
Fix the __GNUC_PREREQ test to reflect this.
Otherwise trying to compile code with gcc-4.2 falls down:
In file included from /usr/include/endian.h:60,
from /usr/include/ctype.h:40,
/usr/include/bits/byteswap.h: In function 'unsigned int __bswap_32(unsigned int)':
/usr/include/bits/byteswap.h:46: error: '__builtin_bswap32' was not declared in this scope
/usr/include/bits/byteswap.h: In function 'long long unsigned int __bswap_64(long long unsigned int)':
/usr/include/bits/byteswap.h:110: error: '__builtin_bswap64' was not declared in this scope
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-28 Mike Frysinger <vapier@gentoo.org>
* bits/byteswap.h [__GNUC__]: Change __GNUC_PREREQ from 4.2 to 4.3.
* sysdeps/x86/bits/byteswap.h [__GNUC__]: Likewise.
---
bits/byteswap.h | 2 +-
sysdeps/x86/bits/byteswap.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/bits/byteswap.h b/bits/byteswap.h
index e19e91a..578a40c 100644
--- a/bits/byteswap.h
+++ b/bits/byteswap.h
@@ -39,7 +39,7 @@
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
#ifdef __GNUC__
-# if __GNUC_PREREQ (4, 2)
+# if __GNUC_PREREQ (4, 3)
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
diff --git a/sysdeps/x86/bits/byteswap.h b/sysdeps/x86/bits/byteswap.h
index babe567..0064833 100644
--- a/sysdeps/x86/bits/byteswap.h
+++ b/sysdeps/x86/bits/byteswap.h
@@ -40,7 +40,7 @@
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#ifdef __GNUC__
-# if __GNUC_PREREQ (4, 2)
+# if __GNUC_PREREQ (4, 3)
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
--
1.7.12.4