From e009d43e3f3879722ffd4cef61586e1285b90f98 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 7 Aug 2008 20:50:22 +0000 Subject: [PATCH] Added ByteSwap macros for BigEndian platforms git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@78 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/ByteSwap.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/code/ByteSwap.h b/code/ByteSwap.h index f591a9ffe..30cfd924e 100644 --- a/code/ByteSwap.h +++ b/code/ByteSwap.h @@ -124,5 +124,24 @@ public: }; }; +// byteswap macros for BigEndian support +#if (defined AI_BUILD_BIG_ENDIAN) +# define AI_SWAP2(p) ByteSwap::Swap2((char*)&(p)) +# define AI_SWAP4(p) ByteSwap::Swap4((char*)&(p)) +# define AI_SWAP8(p) ByteSwap::Swap8((char*)&(p)) +# define AI_SWAP2P(p) ByteSwap::Swap2((char*)(p)) +# define AI_SWAP4P(p) ByteSwap::Swap4((char*)(p)) +# define AI_SWAP8P(p) ByteSwap::Swap8((char*)(p)) +# define BE_NCONST +#else +# define AI_SWAP2(p) +# define AI_SWAP4(p) +# define AI_SWAP8(p) +# define AI_SWAP2P(p) +# define AI_SWAP4P(p) +# define AI_SWAP8P(p) +# define BE_NCONST const +#endif + #endif //!! AI_BYTESWAP_H_INC