Go to the documentation of this file.
31 #define IS_BIG_ENDIAN 4321
32 #define IS_LITTLE_ENDIAN 1234
36 #if defined(__CRYPTLIB__)
38 # if defined(DATA_LITTLEENDIAN)
39 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
41 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
47 # include <sys/isa_defs.h>
48 #elif defined( __FreeBSD__ ) || defined( __OpenBSD__ ) || defined( __NetBSD__ )
49 # include <sys/endian.h>
50 #elif defined( BSD ) && ( BSD >= 199103 ) || defined( __APPLE__ ) || \
51 defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ )
52 # include <machine/endian.h>
53 #elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
54 # if !defined( __MINGW32__ ) && !defined( _AIX )
56 # if !defined( __BEOS__ )
57 # include <byteswap.h>
68 #if defined( BIG_ENDIAN ) && defined( LITTLE_ENDIAN )
69 # if defined( BYTE_ORDER ) && BYTE_ORDER == BIG_ENDIAN
70 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
71 # elif defined( BYTE_ORDER ) && BYTE_ORDER == LITTLE_ENDIAN
72 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
74 #elif defined( BIG_ENDIAN )
75 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
76 #elif defined( LITTLE_ENDIAN )
77 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
80 #if defined( _BIG_ENDIAN ) && defined( _LITTLE_ENDIAN )
81 # if defined( _BYTE_ORDER ) && _BYTE_ORDER == _BIG_ENDIAN
82 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
83 # elif defined( _BYTE_ORDER ) && _BYTE_ORDER == _LITTLE_ENDIAN
84 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
86 #elif defined( _BIG_ENDIAN )
87 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
88 #elif defined( _LITTLE_ENDIAN )
89 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
92 #if defined( __BIG_ENDIAN ) && defined( __LITTLE_ENDIAN )
93 # if defined( __BYTE_ORDER ) && __BYTE_ORDER == __BIG_ENDIAN
94 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
95 # elif defined( __BYTE_ORDER ) && __BYTE_ORDER == __LITTLE_ENDIAN
96 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
98 #elif defined( __BIG_ENDIAN )
99 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
100 #elif defined( __LITTLE_ENDIAN )
101 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
104 #if defined( __BIG_ENDIAN__ ) && defined( __LITTLE_ENDIAN__ )
105 # if defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __BIG_ENDIAN__
106 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
107 # elif defined( __BYTE_ORDER__ ) && __BYTE_ORDER__ == __LITTLE_ENDIAN__
108 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
110 #elif defined( __BIG_ENDIAN__ )
111 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
112 #elif defined( __LITTLE_ENDIAN__ )
113 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
118 #if !defined(PLATFORM_BYTE_ORDER)
120 #if defined( __alpha__ ) || defined( __alpha ) || defined( i386 ) || \
121 defined( __i386__ ) || defined( _M_I86 ) || defined( _M_IX86 ) || \
122 defined( __OS2__ ) || defined( sun386 ) || defined( __TURBOC__ ) || \
123 defined( vax ) || defined( vms ) || defined( VMS ) || \
124 defined( __VMS ) || defined( _M_X64 )
125 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
127 #elif defined( AMIGA ) || defined( applec ) || defined( __AS400__ ) || \
128 defined( _CRAY ) || defined( __hppa ) || defined( __hp9000 ) || \
129 defined( ibm370 ) || defined( mc68000 ) || defined( m68k ) || \
130 defined( __MRC__ ) || defined( __MVS__ ) || defined( __MWERKS__ ) || \
131 defined( sparc ) || defined( __sparc) || defined( SYMANTEC_C ) || \
132 defined( __VOS__ ) || defined( __TIGCC__ ) || defined( __TANDEM ) || \
133 defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX )
134 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
137 # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
139 # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
141 # error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order