xref: /haiku/headers/posix/endian.h (revision 7ee53ed3bd2222305c93a4959f8c587c373ed97c)
1 /*
2  * Copyright 2003-2012 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _ENDIAN_H_
6 #define _ENDIAN_H_
7 
8 
9 #include <config/HaikuConfig.h>
10 
11 
12 /* Defines architecture dependent endian constants.
13  * The constant reflects the byte order, "4" is the most
14  * significant byte, "1" the least significant one.
15  */
16 
17 #if defined(__HAIKU_LITTLE_ENDIAN)
18 #	define LITTLE_ENDIAN	1234
19 #	define BIG_ENDIAN		0
20 #	define BYTE_ORDER		LITTLE_ENDIAN
21 #elif defined(__HAIKU_BIG_ENDIAN)
22 #	define BIG_ENDIAN		4321
23 #	define LITTLE_ENDIAN	0
24 #	define BYTE_ORDER		BIG_ENDIAN
25 #endif
26 
27 #define __BIG_ENDIAN		BIG_ENDIAN
28 #define __LITTLE_ENDIAN		LITTLE_ENDIAN
29 #define __BYTE_ORDER		BYTE_ORDER
30 
31 #endif	/* _ENDIAN_H_ */
32