Fix alignment issues in message sending/reading that would crash IRIX, thanks to Canavan for supplying a shell where I could fix this (#5077)

This commit is contained in:
Thilo Schulz 2011-07-17 01:41:39 +00:00
parent 4c5e9963e3
commit 242c938d7f
3 changed files with 51 additions and 18 deletions

View file

@ -348,6 +348,8 @@ float FloatSwap (const float *f);
#error "Endianness defined as both big and little"
#elif defined( Q3_BIG_ENDIAN )
#define CopyLittleShort(dest, src) CopyShortSwap(dest, src)
#define CopyLittleLong(dest, src) CopyLongSwap(dest, src)
#define LittleShort(x) ShortSwap(x)
#define LittleLong(x) LongSwap(x)
#define LittleFloat(x) FloatSwap(&x)
@ -357,6 +359,8 @@ float FloatSwap (const float *f);
#elif defined( Q3_LITTLE_ENDIAN )
#define CopyLittleShort(dest, src) Com_Memcpy(dest, src, 2)
#define CopyLittleLong(dest, src) Com_Memcpy(dest, src, 4)
#define LittleShort
#define LittleLong
#define LittleFloat