xref: /haiku/headers/posix/endian.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 #ifndef _ENDIAN_H_
2 #define _ENDIAN_H_
3 /*
4 ** Distributed under the terms of the OpenBeOS License.
5 */
6 
7 
8 /* Defines architecture dependent endian constants.
9  * The constant reflects the byte order, "4" is the most
10  * significant byte, "1" the least significant one.
11  */
12 
13 #if defined(__INTEL__)
14 #	define LITTLE_ENDIAN	1234
15 #	define BIG_ENDIAN		0
16 #	define BYTE_ORDER		LITTLE_ENDIAN
17 #elif defined(__POWERPC__)
18 #	define BIG_ENDIAN		4321
19 #	define LITTLE_ENDIAN	0
20 #	define BYTE_ORDER		BIG_ENDIAN
21 #endif
22 
23 #define __BIG_ENDIAN		BIG_ENDIAN
24 #define __LITTLE_ENDIAN		LITTLE_ENDIAN
25 #define __BYTE_ORDER		BYTE_ORDER
26 
27 #endif	/* _ENDIAN_H_ */
28