Skip to content

Commit

Permalink
fix(endian): fix endian testing (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
brglng committed Jul 24, 2024
1 parent 8dfc2fe commit 72bbb7b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/wave.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@

#include "wave.h"

#if defined(__x86_64) || defined(__amd64) || defined(__i386__) || defined(__x86_64__) || defined(__LITTLE_ENDIAN__) || defined(CORE_CM7) || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
#define WAVE_ENDIAN_ORDER_LITTLE 0x41424344UL
#define WAVE_ENDIAN_ORDER_BIG 0x44434241UL
#define WAVE_ENDIAN_ORDER_PDP 0x42414443UL
#define WAVE_ENDIAN_ORDER 'ABCD'

#if WAVE_ENDIAN_ORDER == WAVE_ENDIAN_ORDER_LITTLE
#define WAVE_ENDIAN_LITTLE 1
#define WAVE_ENDIAN_BIG 0
#elif defined(__BIG_ENDIAN__)
#elif WAVE_ENDIAN_ORDER == WAVE_ENDIAN_ORDER_BIG
#define WAVE_ENDIAN_LITTLE 0
#define WAVE_ENDIAN_BIG 1
#else
#error "unsupported endianess"
#endif

#if WAVE_ENDIAN_LITTLE
Expand Down

0 comments on commit 72bbb7b

Please # to comment.