From 86495a1f22cd53399697dd558d65f50ed60dcdb4 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 19 Mar 2012 01:44:21 +0100 Subject: Fix endianness detection macros and win32 is little endian too --- include/endianness.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include/endianness.h') diff --git a/include/endianness.h b/include/endianness.h index a34cbf4..1f99fa7 100644 --- a/include/endianness.h +++ b/include/endianness.h @@ -1,6 +1,24 @@ #ifndef ENDIANNESS_H #define ENDIANNESS_H +#ifndef __LITTLE_ENDIAN +#define __LITTLE_ENDIAN 1234 +#endif + +#ifndef __BIG_ENDIAN +#define __BIG_ENDIAN 4321 +#endif + +#ifndef __BYTE_ORDER +#ifdef __LITTLE_ENDIAN__ +#define __BYTE_ORDER __LITTLE_ENDIAN +#else +#ifdef __BIG_ENDIAN__ +#define __BYTE_ORDER __BIG_ENDIAN +#endif +#endif +#endif + #ifndef be16toh #if __BYTE_ORDER == __BIG_ENDIAN #define be16toh(x) (x) -- cgit v1.1-32-gdbae