diff options
author | Chris Robinson <[email protected]> | 2018-05-21 17:51:57 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-05-21 17:51:57 -0700 |
commit | 720ec2beea665c6098753e13713b165fc3729162 (patch) | |
tree | 67823303b36aa15561fdfb14d79f7d6da01a390b /OpenAL32/Include | |
parent | a235259b5e7788b6e5f77b15ca0f26370914fbc1 (diff) |
Use the __BYTE_ORDER__ macro when available
Diffstat (limited to 'OpenAL32/Include')
-rw-r--r-- | OpenAL32/Include/alMain.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 886f3ab1..093f7950 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -184,11 +184,15 @@ inline int fallback_ctz64(ALuint64 value) #define CTZ64 fallback_ctz64 #endif +#if defined(__BYTE_ORDER__) && defined(__LITTLE_ENDIAN__) +#define IS_LITTLE_ENDIAN (__BYTE_ORDER__ == __LITTLE_ENDIAN__) +#else static const union { ALuint u; ALubyte b[sizeof(ALuint)]; } EndianTest = { 1 }; #define IS_LITTLE_ENDIAN (EndianTest.b[0] == 1) +#endif #define COUNTOF(x) (sizeof(x) / sizeof(0[x])) |