From 0f3a75138a8c4e04e7722566e74963bbcb807445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 17 May 2003 15:26:18 +0000 Subject: [PATCH] Our endian.h header was still missing. Defines constants to determine the platform's endian. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3251 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/posix/endian.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 headers/posix/endian.h diff --git a/headers/posix/endian.h b/headers/posix/endian.h new file mode 100644 index 0000000000..9403a51b86 --- /dev/null +++ b/headers/posix/endian.h @@ -0,0 +1,27 @@ +#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. + */ + +#if defined(__INTEL__) +# define LITTLE_ENDIAN 1234 +# define BIG_ENDIAN 0 +# define BYTE_ORDER LITTLE_ENDIAN +#elif defined(__POWERPC__) +# 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_ */