Fix compilation with GCC 4.7
This commit is contained in:
parent
df90fd16bc
commit
36fa1cd15a
@ -16,7 +16,6 @@ typedef uint8_t u8;
|
|||||||
|
|
||||||
#define BIT(n) (1U << (n))
|
#define BIT(n) (1U << (n))
|
||||||
|
|
||||||
#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
|
|
||||||
#ifndef __BYTE_ORDER__
|
#ifndef __BYTE_ORDER__
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#define __BYTE_ORDER__ BYTE_ORDER
|
#define __BYTE_ORDER__ BYTE_ORDER
|
||||||
@ -25,11 +24,14 @@ typedef uint8_t u8;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __llvm__
|
#ifndef __llvm__
|
||||||
|
#if !defined(__GNUC__) || (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)
|
||||||
|
|
||||||
static inline uint16_t __builtin_bswap16(uint16_t x)
|
static inline uint16_t __builtin_bswap16(uint16_t x)
|
||||||
{
|
{
|
||||||
return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);
|
return ((x << 8) & 0xff00) | ((x >> 8) & 0x00ff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
|
||||||
static inline uint32_t __builtin_bswap32(uint32_t x)
|
static inline uint32_t __builtin_bswap32(uint32_t x)
|
||||||
{
|
{
|
||||||
return ((x << 24) & 0xff000000) |
|
return ((x << 24) & 0xff000000) |
|
||||||
@ -45,6 +47,7 @@ static inline uint64_t __builtin_bswap64(uint64_t x)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define be_dword(a) __builtin_bswap64(a)
|
#define be_dword(a) __builtin_bswap64(a)
|
||||||
|
Loading…
Reference in New Issue
Block a user