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 1
1
CORE new-smt-backend
2
2
main.c
3
- --big-endian -D__BIG_ENDIAN__
3
+ --big-endian -DUSE_BIG_ENDIAN
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change 1
1
#include <assert.h>
2
2
#include <stdint.h>
3
3
4
- #if !defined(__LITTLE_ENDIAN__ ) && !defined(__BIG_ENDIAN__ )
4
+ #if !defined(USE_LITTLE_ENDIAN ) && !defined(USE_BIG_ENDIAN )
5
5
6
6
# if defined(__avr32__ ) || defined(__hppa__ ) || defined(__m68k__ ) || \
7
7
defined(__mips__ ) || defined(__powerpc__ ) || defined(__s390__ ) || \
8
8
defined(__s390x__ ) || defined(__sparc__ )
9
9
10
- # define __BIG_ENDIAN__
10
+ # define USE_BIG_ENDIAN
11
11
12
12
# endif
13
13
@@ -21,7 +21,7 @@ int main()
21
21
uint8_t * y = (uint8_t * )x ;
22
22
uint16_t z = * ((uint16_t * )(y + 1 ));
23
23
24
- #ifdef __BIG_ENDIAN__
24
+ #ifdef USE_BIG_ENDIAN
25
25
assert (z == 256u );
26
26
#else
27
27
assert (z == 512u );
Original file line number Diff line number Diff line change 1
1
CORE new-smt-backend
2
2
main.c
3
- --little-endian -D__LITTLE_ENDIAN__
3
+ --little-endian -DUSE_LITTLE_ENDIAN
4
4
^EXIT=0$
5
5
^SIGNAL=0$
6
6
^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
-
16
1
typedef struct my_struct
17
2
{
18
3
// We hope these are 32 bit each on all architectures,
@@ -37,7 +22,7 @@ int main()
37
22
logAppl .b = 0x01000002 ;
38
23
CopyBuffer ((unsigned char * )& logAppl );
39
24
40
- #ifdef __BIG_ENDIAN__
25
+ #if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
41
26
assert (arrayTmp [0 ]== 0 );
42
27
assert (arrayTmp [1 ]== 0 );
43
28
assert (arrayTmp [2 ]== 0 );
You can’t perform that action at this time.
0 commit comments