diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-17 11:45:38 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-08-17 11:45:38 +0000 |
commit | 755525ad233b15c7811b2860f74f70b7c5a20778 (patch) | |
tree | f911bfbe1a4ba719a4b1e3a493a4f2798565251b /include | |
parent | 7aaf5bf3db44c94bd630e07d63c3a4a1d92e44f4 (diff) | |
download | external_llvm-755525ad233b15c7811b2860f74f70b7c5a20778.zip external_llvm-755525ad233b15c7811b2860f74f70b7c5a20778.tar.gz external_llvm-755525ad233b15c7811b2860f74f70b7c5a20778.tar.bz2 |
There is this new "LLVM" compiler that supports __builtin_bswap but thinks it's gcc 4.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/MathExtras.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index 80d11ae..982813f 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -126,7 +126,8 @@ inline uint16_t ByteSwap_16(uint16_t Value) { /// ByteSwap_32 - This function returns a byte-swapped representation of the /// 32-bit argument, Value. inline uint32_t ByteSwap_32(uint32_t Value) { -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) +#if defined(__llvm__) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) return __builtin_bswap32(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_ulong(Value); @@ -142,7 +143,8 @@ inline uint32_t ByteSwap_32(uint32_t Value) { /// ByteSwap_64 - This function returns a byte-swapped representation of the /// 64-bit argument, Value. inline uint64_t ByteSwap_64(uint64_t Value) { -#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) +#if defined(__llvm__) || \ + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC) return __builtin_bswap64(Value); #elif defined(_MSC_VER) && !defined(_DEBUG) return _byteswap_uint64(Value); |