]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
types.h: Use __builtin_bswap* with clang.
authorVladimir Serbinenko <phcoder@gmail.com>
Tue, 3 Mar 2015 08:12:10 +0000 (09:12 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 3 Mar 2015 19:50:37 +0000 (20:50 +0100)
clang pretends to be GCC 4.2 but we use __builtin_bswap* only with GCC 4.3+.
clang support __builtin_bswap*, so use it.

include/grub/types.h

index 79f765c620d5d9371985e9da8e7fb8671ee2e39f..e732efb5cf039308d61d6e080c4f830947f3a8dd 100644 (file)
@@ -179,7 +179,7 @@ static inline grub_uint16_t grub_swap_bytes16(grub_uint16_t _x)
                     | (_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)
 {
        return __builtin_bswap32(x);