byteptr.h: include endian.h to help define WRITE/READ macros correctly according to endianness

This commit is contained in:
Monster Iestyn 2018-11-08 17:16:54 +00:00
parent fd20bbb54e
commit fa80d61799
1 changed files with 5 additions and 3 deletions

View File

@ -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