mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 14:01:45 +00:00
Fixed compilation on macOS
This commit is contained in:
parent
3f17d64f90
commit
a419b581a8
2 changed files with 16 additions and 1 deletions
15
src/m_swap.h
15
src/m_swap.h
|
@ -46,6 +46,11 @@ inline short LittleShort(int x)
|
|||
return OSSwapLittleToHostInt16((uint16_t)x);
|
||||
}
|
||||
|
||||
inline unsigned short LittleShort(unsigned int x)
|
||||
{
|
||||
return OSSwapLittleToHostInt16((uint16_t)x);
|
||||
}
|
||||
|
||||
inline int LittleLong(int x)
|
||||
{
|
||||
return OSSwapLittleToHostInt32((uint32_t)x);
|
||||
|
@ -56,6 +61,16 @@ inline unsigned int LittleLong(unsigned int x)
|
|||
return OSSwapLittleToHostInt32(x);
|
||||
}
|
||||
|
||||
inline int LittleLong(long x)
|
||||
{
|
||||
return OSSwapLittleToHostInt32((uint32_t)x);
|
||||
}
|
||||
|
||||
inline unsigned int LittleLong(unsigned long x)
|
||||
{
|
||||
return OSSwapLittleToHostInt32((uint32_t)x);
|
||||
}
|
||||
|
||||
inline short BigShort(short x)
|
||||
{
|
||||
return (short)OSSwapBigToHostInt16((uint16_t)x);
|
||||
|
|
|
@ -1294,7 +1294,7 @@ FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **
|
|||
assert(base != nullptr);
|
||||
if (arc.isReading() || !arc.w->inObject() || defval == nullptr || value != *defval)
|
||||
{
|
||||
ptrdiff_t vv = value == nullptr ? -1 : value - base;
|
||||
int64_t vv = value == nullptr ? -1 : value - base;
|
||||
Serialize(arc, key, vv, nullptr);
|
||||
value = vv < 0 ? nullptr : base + vv;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue