From fa80d6179978b1d8c88eda73d1efde1f4194c2d4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 8 Nov 2018 17:16:54 +0000 Subject: [PATCH] byteptr.h: include endian.h to help define WRITE/READ macros correctly according to endianness --- src/byteptr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/byteptr.h b/src/byteptr.h index 410d7c00..364e6520 100644 --- a/src/byteptr.h +++ b/src/byteptr.h @@ -15,7 +15,9 @@ #define DEALIGNED #endif -#ifndef _BIG_ENDIAN +#include "endian.h" + +#ifndef SRB2_BIG_ENDIAN // // Little-endian machines // @@ -75,7 +77,7 @@ #define READANGLE(p) *((angle_t *)p)++ #endif -#else //_BIG_ENDIAN +#else //SRB2_BIG_ENDIAN // // definitions for big-endian machines with alignment constraints. // @@ -144,7 +146,7 @@ FUNCINLINE static ATTRINLINE UINT32 readulong(void *ptr) #define READCHAR(p) ({ char *p_tmp = ( char *)p; char b = *p_tmp; p_tmp++; p = (void *)p_tmp; b; }) #define READFIXED(p) ({ fixed_t *p_tmp = (fixed_t *)p; fixed_t b = readlong(p); p_tmp++; p = (void *)p_tmp; b; }) #define READANGLE(p) ({ angle_t *p_tmp = (angle_t *)p; angle_t b = readulong(p); p_tmp++; p = (void *)p_tmp; b; }) -#endif //_BIG_ENDIAN +#endif //SRB2_BIG_ENDIAN #undef DEALIGNED