grub2/0350-types.h-Use-__builtin_bswap-with-clang.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

28 lines
989 B
Diff

From 77697d14e55eaf878639a630ab45563fa9556a97 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Tue, 3 Mar 2015 09:12:10 +0100
Subject: [PATCH 350/506] 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.
---
include/grub/types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/grub/types.h b/include/grub/types.h
index 79f765c..e732efb 100644
--- a/include/grub/types.h
+++ b/include/grub/types.h
@@ -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);
--
2.4.3