From c3c94c6574513a60926e3d591f68af4cd091cdc0 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 17 Aug 2015 11:36:46 -0400 Subject: [PATCH] Use built-in byte swap functions on LLVM --- source/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/types.h b/source/types.h index 16140d0..918f2c5 100644 --- a/source/types.h +++ b/source/types.h @@ -24,6 +24,7 @@ typedef uint8_t u8; #define __ORDER_BIG_ENDIAN__ BIG_ENDIAN #endif +#ifndef __llvm__ static inline uint16_t __builtin_bswap16(uint16_t x) { return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff); @@ -43,6 +44,7 @@ static inline uint64_t __builtin_bswap64(uint64_t x) ((uint64_t)__builtin_bswap32(x&0xFFFFFFFF) << 32); } #endif +#endif #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ #define be_dword(a) __builtin_bswap64(a)