2009-11-24 22:44:07 +03:00
|
|
|
/*
|
2019-08-27 18:44:57 +03:00
|
|
|
* Copyright 2003-2019 Haiku, Inc. All rights reserved.
|
2009-11-24 22:44:07 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2003-05-17 19:26:18 +04:00
|
|
|
#ifndef _ENDIAN_H_
|
|
|
|
#define _ENDIAN_H_
|
2009-11-24 22:44:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
#include <config/HaikuConfig.h>
|
2017-09-10 22:04:02 +03:00
|
|
|
|
2003-05-17 19:26:18 +04:00
|
|
|
|
2019-08-27 18:44:57 +03:00
|
|
|
/* Defines architecture independent endian constants.
|
|
|
|
* The constant reflects the byte order, "4" is the most significant byte,
|
|
|
|
* "1" the least significant one.
|
2003-05-17 19:26:18 +04:00
|
|
|
*/
|
2019-08-27 18:44:57 +03:00
|
|
|
#define LITTLE_ENDIAN 1234
|
|
|
|
#define BIG_ENDIAN 4321
|
2003-05-17 19:26:18 +04:00
|
|
|
|
2019-08-27 18:44:57 +03:00
|
|
|
/* Define the machine BYTE_ORDER depending on platform endianness */
|
2009-11-24 22:44:07 +03:00
|
|
|
#if defined(__HAIKU_LITTLE_ENDIAN)
|
2003-05-17 19:26:18 +04:00
|
|
|
# define BYTE_ORDER LITTLE_ENDIAN
|
2009-11-24 22:44:07 +03:00
|
|
|
#elif defined(__HAIKU_BIG_ENDIAN)
|
2003-05-17 19:26:18 +04:00
|
|
|
# define BYTE_ORDER BIG_ENDIAN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __BIG_ENDIAN BIG_ENDIAN
|
|
|
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
|
|
|
#define __BYTE_ORDER BYTE_ORDER
|
|
|
|
|
2019-08-27 18:44:57 +03:00
|
|
|
#endif /* _ENDIAN_H_ */
|