File tree Expand file tree Collapse file tree 4 files changed +6
-21
lines changed
Expand file tree Collapse file tree 4 files changed +6
-21
lines changed Original file line number Diff line number Diff line change 11CORE new-smt-backend
22main.c
3- --big-endian -D__BIG_ENDIAN__
3+ --big-endian -DUSE_BIG_ENDIAN
44^EXIT=0$
55^SIGNAL=0$
66^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 11#include <assert.h>
22#include <stdint.h>
33
4- #if !defined(__LITTLE_ENDIAN__ ) && !defined(__BIG_ENDIAN__ )
4+ #if !defined(USE_LITTLE_ENDIAN ) && !defined(USE_BIG_ENDIAN )
55
66# if defined(__avr32__ ) || defined(__hppa__ ) || defined(__m68k__ ) || \
77 defined(__mips__ ) || defined(__powerpc__ ) || defined(__s390__ ) || \
88 defined(__s390x__ ) || defined(__sparc__ )
99
10- # define __BIG_ENDIAN__
10+ # define USE_BIG_ENDIAN
1111
1212# endif
1313
@@ -21,7 +21,7 @@ int main()
2121 uint8_t * y = (uint8_t * )x ;
2222 uint16_t z = * ((uint16_t * )(y + 1 ));
2323
24- #ifdef __BIG_ENDIAN__
24+ #ifdef USE_BIG_ENDIAN
2525 assert (z == 256u );
2626#else
2727 assert (z == 512u );
Original file line number Diff line number Diff line change 11CORE new-smt-backend
22main.c
3- --little-endian -D__LITTLE_ENDIAN__
3+ --little-endian -DUSE_LITTLE_ENDIAN
44^EXIT=0$
55^SIGNAL=0$
66^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1- // Determine endianness.
2- // Follows http://wiki.debian.org/ArchitectureSpecificsMemo
3-
4- #if !defined(__LITTLE_ENDIAN__ ) && !defined(__BIG_ENDIAN__ )
5-
6- #if defined(__avr32__ ) || defined(__hppa__ ) || defined(__m68k__ ) || \
7- defined(__mips__ ) || defined(__powerpc__ ) || defined(__s390__ ) || \
8- defined(__s390x__ ) || defined(__sparc__ )
9-
10- #define __BIG_ENDIAN__
11-
12- #endif
13-
14- #endif
15-
161typedef struct my_struct
172{
183 // We hope these are 32 bit each on all architectures,
@@ -37,7 +22,7 @@ int main()
3722 logAppl .b = 0x01000002 ;
3823 CopyBuffer ((unsigned char * )& logAppl );
3924
40- #ifdef __BIG_ENDIAN__
25+ #if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
4126 assert (arrayTmp [0 ]== 0 );
4227 assert (arrayTmp [1 ]== 0 );
4328 assert (arrayTmp [2 ]== 0 );
You can’t perform that action at this time.
0 commit comments