Added overloaded Little...() functions for big endian targets

https://forum.zdoom.org/viewtopic.php?t=59197
This commit is contained in:
alexey.lysiuk 2018-01-25 13:35:34 +02:00
parent e728634497
commit 1b4e3d3f94

View file

@ -91,6 +91,16 @@ inline unsigned short LittleShort (unsigned short x)
return (unsigned short)((x>>8) | (x<<8));
}
inline short LittleShort (int x)
{
return LittleShort((short)x);
}
inline unsigned short LittleShort (unsigned int x)
{
return LittleShort((unsigned short)x);
}
// Swapping 32bit.
inline unsigned int LittleLong (unsigned int x)
{
@ -110,6 +120,16 @@ inline int LittleLong (int x)
| (((unsigned int)x)<<24));
}
inline unsigned int LittleLong(unsigned long x)
{
return LittleLong((unsigned int)x);
}
inline int LittleLong(long x)
{
return LittleLong((int)x);
}
#define BigShort(x) (x)
#define BigLong(x) (x)