Fix PR4614: the Intel C compiler defines _GNUC__
but does not provide __builtin_bswap32/64. llvm-svn: 76896
This commit is contained in:
parent
f4981105ca
commit
1f3b8c0d16
|
@ -108,7 +108,7 @@ inline uint16_t ByteSwap_16(uint16_t Value) {
|
||||||
/// ByteSwap_32 - This function returns a byte-swapped representation of the
|
/// ByteSwap_32 - This function returns a byte-swapped representation of the
|
||||||
/// 32-bit argument, Value.
|
/// 32-bit argument, Value.
|
||||||
inline uint32_t ByteSwap_32(uint32_t Value) {
|
inline uint32_t ByteSwap_32(uint32_t Value) {
|
||||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC)
|
||||||
return __builtin_bswap32(Value);
|
return __builtin_bswap32(Value);
|
||||||
#elif defined(_MSC_VER) && !defined(_DEBUG)
|
#elif defined(_MSC_VER) && !defined(_DEBUG)
|
||||||
return _byteswap_ulong(Value);
|
return _byteswap_ulong(Value);
|
||||||
|
@ -124,7 +124,7 @@ inline uint32_t ByteSwap_32(uint32_t Value) {
|
||||||
/// ByteSwap_64 - This function returns a byte-swapped representation of the
|
/// ByteSwap_64 - This function returns a byte-swapped representation of the
|
||||||
/// 64-bit argument, Value.
|
/// 64-bit argument, Value.
|
||||||
inline uint64_t ByteSwap_64(uint64_t Value) {
|
inline uint64_t ByteSwap_64(uint64_t Value) {
|
||||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && !defined(__ICC)
|
||||||
return __builtin_bswap64(Value);
|
return __builtin_bswap64(Value);
|
||||||
#elif defined(_MSC_VER) && !defined(_DEBUG)
|
#elif defined(_MSC_VER) && !defined(_DEBUG)
|
||||||
return _byteswap_uint64(Value);
|
return _byteswap_uint64(Value);
|
||||||
|
|
Loading…
Reference in New Issue