Fix:Core:Better endian handling
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 16 Aug 2011 16:37:51 +0000 (16:37 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 16 Aug 2011 16:37:51 +0000 (16:37 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4683 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/configure.in
navit/navit/endianess.h

index 84683f0..5889831 100644 (file)
@@ -815,6 +815,8 @@ AC_CHECK_HEADER(
                ,
 )
 
+AC_CHECK_HEADER(sys/endian.h,AC_DEFINE([USE_SYS_ENDIAN_H], [1], [Define to 1 if you have sys/endian.h],),)
+
 PACKAGE=navit
 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
index 5944575..01fb265 100644 (file)
   #include <byteswap.h>
 #elif defined(USE_SYS_ENDIAN_H)
   #include <sys/endian.h>
+#if defined(_BYTE_ORDER) && !defined(__BYTE_ORDER)
+#define __BYTE_ORDER _BYTE_ORDER
+#define __LITTLE_ENDIAN _LITTLE_ENDIAN
+#define __BIG_ENDIAN _BIG_ENDIAN
+#endif
 #elif defined(__APPLE__)
   #include <libkern/OSByteOrder.h>
   #define __bswap_16 OSSwapInt16