2003-05-17 19:26:18 +04:00
|
|
|
#ifndef _ENDIAN_H_
|
|
|
|
#define _ENDIAN_H_
|
|
|
|
/*
|
|
|
|
** Distributed under the terms of the OpenBeOS License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/* Defines architecture dependent endian constants.
|
|
|
|
* The constant reflects the byte order, "4" is the most
|
|
|
|
* significant byte, "1" the least significant one.
|
|
|
|
*/
|
|
|
|
|
2009-08-17 19:12:13 +04:00
|
|
|
#if defined(__INTEL__) || defined(__ARM__) || defined(__MIPSEL__)
|
2003-05-17 19:26:18 +04:00
|
|
|
# define LITTLE_ENDIAN 1234
|
|
|
|
# define BIG_ENDIAN 0
|
|
|
|
# define BYTE_ORDER LITTLE_ENDIAN
|
2007-10-25 04:36:36 +04:00
|
|
|
#elif defined(__POWERPC__) || defined(__M68K__)
|
2003-05-17 19:26:18 +04:00
|
|
|
# define BIG_ENDIAN 4321
|
|
|
|
# define LITTLE_ENDIAN 0
|
|
|
|
# define BYTE_ORDER BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
|
|
|
|
#endif /* _ENDIAN_H_ */
|