Fixed compilation on macOS

This commit is contained in:
alexey.lysiuk 2016-09-24 13:15:45 +03:00
parent 3f17d64f90
commit a419b581a8
2 changed files with 16 additions and 1 deletions

View File

@ -46,6 +46,11 @@ inline short LittleShort(int x)
return OSSwapLittleToHostInt16((uint16_t)x); return OSSwapLittleToHostInt16((uint16_t)x);
} }
inline unsigned short LittleShort(unsigned int x)
{
return OSSwapLittleToHostInt16((uint16_t)x);
}
inline int LittleLong(int x) inline int LittleLong(int x)
{ {
return OSSwapLittleToHostInt32((uint32_t)x); return OSSwapLittleToHostInt32((uint32_t)x);
@ -56,6 +61,16 @@ inline unsigned int LittleLong(unsigned int x)
return OSSwapLittleToHostInt32(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) inline short BigShort(short x)
{ {
return (short)OSSwapBigToHostInt16((uint16_t)x); return (short)OSSwapBigToHostInt16((uint16_t)x);

View File

@ -1294,7 +1294,7 @@ FSerializer &SerializePointer(FSerializer &arc, const char *key, T *&value, T **
assert(base != nullptr); assert(base != nullptr);
if (arc.isReading() || !arc.w->inObject() || defval == nullptr || value != *defval) 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); Serialize(arc, key, vv, nullptr);
value = vv < 0 ? nullptr : base + vv; value = vv < 0 ? nullptr : base + vv;
} }