From 1f1607cc6d2367d1fb6e41a033d5a020dda78943 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Tue, 10 Nov 2020 19:49:21 -0500 Subject: [PATCH] This was lost --- src/m_swap.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/m_swap.h b/src/m_swap.h index c1e5e39b7..faa54e0b2 100644 --- a/src/m_swap.h +++ b/src/m_swap.h @@ -44,4 +44,13 @@ #define MSBF_LONG SWAP_LONG #endif +// Big to little endian +#ifdef SRB2_LITTLE_ENDIAN + #define BIGENDIAN_LONG(x) ((INT32)(((x)>>24)&0xff)|(((x)<<8)&0xff0000)|(((x)>>8)&0xff00)|(((x)<<24)&0xff000000)) + #define BIGENDIAN_SHORT(x) ((INT16)(((x)>>8)|((x)<<8))) +#else + #define BIGENDIAN_LONG(x) ((INT32)(x)) + #define BIGENDIAN_SHORT(x) ((INT16)(x)) +#endif + #endif