mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-18 01:21:32 +00:00
Added overloaded Little...() functions for big endian targets
https://forum.zdoom.org/viewtopic.php?t=59197
This commit is contained in:
parent
e728634497
commit
1b4e3d3f94
1 changed files with 20 additions and 0 deletions
20
src/m_swap.h
20
src/m_swap.h
|
@ -91,6 +91,16 @@ inline unsigned short LittleShort (unsigned short x)
|
||||||
return (unsigned short)((x>>8) | (x<<8));
|
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.
|
// Swapping 32bit.
|
||||||
inline unsigned int LittleLong (unsigned int x)
|
inline unsigned int LittleLong (unsigned int x)
|
||||||
{
|
{
|
||||||
|
@ -110,6 +120,16 @@ inline int LittleLong (int x)
|
||||||
| (((unsigned int)x)<<24));
|
| (((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 BigShort(x) (x)
|
||||||
#define BigLong(x) (x)
|
#define BigLong(x) (x)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue