xref: /haiku/headers/posix/endian.h (revision cb29eafe2586fdb2d7685afa69fdab5d88a8b576)
1 /*
2  * Copyright 2003-2019 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 independent endian constants.
13  * The constant reflects the byte order, "4" is the most significant byte,
14  * "1" the least significant one.
15  */
16 #define LITTLE_ENDIAN	1234
17 #define BIG_ENDIAN		4321
18 
19 /* Define the machine BYTE_ORDER depending on platform endianness */
20 #if defined(__HAIKU_LITTLE_ENDIAN)
21 #	define BYTE_ORDER		LITTLE_ENDIAN
22 #elif defined(__HAIKU_BIG_ENDIAN)
23 #	define BYTE_ORDER		BIG_ENDIAN
24 #endif
25 
26 #define __BIG_ENDIAN		BIG_ENDIAN
27 #define __LITTLE_ENDIAN		LITTLE_ENDIAN
28 #define __BYTE_ORDER		BYTE_ORDER
29 
30 #endif	/* _ENDIAN_H_ */
31