types.h: Use __builtin_bswap* with clang.

clang pretends to be GCC 4.2 but we use __builtin_bswap* only with GCC 4.3+.
clang support __builtin_bswap*, so use it.
This commit is contained in:
Vladimir Serbinenko 2015-03-03 09:12:10 +01:00
parent aa6ccc05c1
commit 77697d14e5

View file

@ -179,7 +179,7 @@ static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
| (_x >> 56)); \ | (_x >> 56)); \
}) })
#if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) #if (defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3)) || defined(__clang__)
static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x) static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x)
{ {
return __builtin_bswap32(x); return __builtin_bswap32(x);