mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-27 04:41:23 +00:00
byteptr.h: include endian.h to help define WRITE/READ macros correctly according to endianness
This commit is contained in:
parent
fd20bbb54e
commit
fa80d61799
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue