Skip to content

Commit df29c60

Browse files
committed
Fix little/big endian detection for Tornado (2)
1 parent 9b905ec commit df29c60

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tornado/Common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ extern "C" {
4141
#endif
4242

4343
#if defined(FREEARC_INTEL_BYTE_ORDER)
44-
#if _BIG_ENDIAN
44+
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
4545
#error "You're compiling for Motorola byte order, but FREEARC_INTEL_BYTE_ORDER was defined."
4646
#endif
4747
#elif defined(FREEARC_MOTOROLA_BYTE_ORDER)

tornado/tor_test.cpp

+2-5
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@
2828
#endif
2929

3030
/* Test for a big-endian machine */
31-
#if defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN) || defined(_BIG_ENDIAN) || \
32-
(defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
31+
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
3332
#define FREEARC_MOTOROLA_BYTE_ORDER 1
3433
#else
35-
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
36-
#define FREEARC_INTEL_BYTE_ORDER 1
37-
#endif
34+
#define FREEARC_INTEL_BYTE_ORDER 1
3835
#endif
3936

4037
#include <stdint.h>

0 commit comments

Comments
 (0)