From c9d6789ebe028a260d3e5be0c26b7d02fdfe99fe Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 28 Nov 2012 23:04:32 -0500 Subject: byteswap.h: fix gcc ver test for __builtin_bswap{32,64} The __builtin_bswap* functions were introduced in gcc-4.3, not gcc-4.2. Fix the __GNUC_PREREQ tests 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 --- bits/byteswap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bits') diff --git a/bits/byteswap.h b/bits/byteswap.h index e19e91ada7..7e5daedb83 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) { @@ -70,7 +70,7 @@ __bswap_32 (unsigned int __bsx) | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56))) -# if __GNUC_PREREQ (4, 2) +# if __GNUC_PREREQ (4, 3) static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { -- cgit v1.2.3