diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 14:55:50 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2009-07-27 14:55:50 +0000 |
commit | 752f1733fe7b170ebe940726b5286dde34f013bb (patch) | |
tree | 5a0090697cdf2fb08d9574758b7f51348d7b5b58 /navit/data.h | |
parent | bf6938b08beac71bf7ea266086fc1dcbd8927587 (diff) | |
download | navit-752f1733fe7b170ebe940726b5286dde34f013bb.tar.gz |
Fix:map_mg:Applied big endian patch from trac #322|Thanks pini
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2418 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/data.h')
-rw-r--r-- | navit/data.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/navit/data.h b/navit/data.h index 19ce00708..19928a391 100644 --- a/navit/data.h +++ b/navit/data.h @@ -20,6 +20,12 @@ #ifndef NAVIT_DATA_H #define NAVIT_DATA_H +#include "config.h" + +#ifdef WORDS_BIGENDIAN +#include <byteswap.h> +#endif + static inline unsigned char get_u8(unsigned char **p) { @@ -31,7 +37,11 @@ get_u16(unsigned char **p) { unsigned short ret; ret=*((unsigned short *)*p); *p+=sizeof(unsigned short); +#ifdef WORDS_BIGENDIAN + return __bswap_16(ret); +#else return ret; +#endif } static inline unsigned short @@ -66,7 +76,11 @@ get_u32(unsigned char **p) { unsigned long ret; ret=*((unsigned int *)*p); *p+=sizeof(unsigned int); +#ifdef WORDS_BIGENDIAN + return __bswap_32(ret); +#else return ret; +#endif } static inline unsigned int |