removing more unused stuff
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
@@ -1528,7 +1528,7 @@ namespace GridMate
|
||||
if (0 != WSAIoctl( m_socket, SIO_GET_MULTIPLE_EXTENSION_FUNCTION_POINTER, &functionTableId,
|
||||
sizeof(GUID), (void**)&m_RIO_FN_TABLE, sizeof(m_RIO_FN_TABLE), &dwBytes, 0, 0))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not initialize RIO: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not initialize RIO: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
else
|
||||
@@ -1543,13 +1543,13 @@ namespace GridMate
|
||||
|
||||
if ((m_events[WakeupOnSend] = WSACreateEvent()) == WSA_INVALID_EVENT)
|
||||
{
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
if ((m_events[ReceiveEvent] = WSACreateEvent()) == WSA_INVALID_EVENT)
|
||||
{
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
RIO_NOTIFICATION_COMPLETION typeRecv;
|
||||
@@ -1559,13 +1559,13 @@ namespace GridMate
|
||||
m_RIORecvQueue = m_RIO_FN_TABLE.RIOCreateCompletionQueue(maxOutstandingReceive, &typeRecv);
|
||||
if (m_RIORecvQueue == RIO_INVALID_CQ)
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
if ((m_events[SendEvent] = WSACreateEvent()) == WSA_INVALID_EVENT)
|
||||
{
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Failed WSACreateEvent(): %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
RIO_NOTIFICATION_COMPLETION typeSend;
|
||||
@@ -1575,7 +1575,7 @@ namespace GridMate
|
||||
m_RIOSendQueue = m_RIO_FN_TABLE.RIOCreateCompletionQueue(maxOutstandingSend, &typeSend);
|
||||
if (m_RIOSendQueue == RIO_INVALID_CQ)
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not RIOCreateCompletionQueue: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
@@ -1583,7 +1583,7 @@ namespace GridMate
|
||||
maxReceiveDataBuffers, maxOutstandingSend, maxSendDataBuffers, m_RIORecvQueue, m_RIOSendQueue, pContext);
|
||||
if (m_requestQueue == RIO_INVALID_RQ)
|
||||
{
|
||||
AZ_Error("GridMate", m_requestQueue != NULL, "Could not RIOCreateRequestQueue: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", m_requestQueue != NULL, "Could not RIOCreateRequestQueue: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
@@ -1596,24 +1596,24 @@ namespace GridMate
|
||||
//Setup Recv raw buffer and RIO record
|
||||
if (nullptr == (m_rawRecvBuffer = AllocRIOBuffer(bufferSize, m_RIORecvBufferCount, &recvAllocated)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
if (RIO_INVALID_BUFFERID == (recvBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawRecvBuffer, bufferSize * m_RIORecvBufferCount)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
//Setup Recv address raw buffer and RIO record
|
||||
if (nullptr == (m_rawRecvAddressBuffer = AllocRIOBuffer(sizeof(SOCKADDR_INET), m_RIORecvBufferCount, &recvAddrsAllocated)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
if (RIO_INVALID_BUFFERID == (recvAddressBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawRecvAddressBuffer, sizeof(SOCKADDR_INET) * m_RIORecvBufferCount)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
@@ -1640,7 +1640,7 @@ namespace GridMate
|
||||
//Start Receive Handler
|
||||
if (false == m_RIO_FN_TABLE.RIOReceiveEx(m_requestQueue, &m_RIORecvBuffer[i], 1, NULL, &m_RIORecvAddressBuffer[i], NULL, NULL, 0, pBuffer))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
}
|
||||
@@ -1650,25 +1650,25 @@ namespace GridMate
|
||||
//setup send raw buffer and RIO record
|
||||
if (nullptr == (m_rawSendBuffer = AllocRIOBuffer(bufferSize, m_RIOSendBufferCount, &sendAllocated)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not allocate buffer: %u", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
if (RIO_INVALID_BUFFERID == (sendBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawSendBuffer, m_RIOSendBufferCount * bufferSize)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
//setup send address raw buffer and RIO record
|
||||
if (nullptr == (m_rawSendAddressBuffer = AllocRIOBuffer(sizeof(SOCKADDR_INET), m_RIOSendBufferCount, &sendAddrsAllocated)))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not allocate send address buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not allocate send address buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
if (RIO_INVALID_BUFFERID == (sendAddressBufferId = m_RIO_FN_TABLE.RIORegisterBuffer(m_rawSendAddressBuffer, m_RIOSendBufferCount * sizeof(SOCKADDR_INET))))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not register buffer: %u\n", GridMate::Platform::GetSocketError());
|
||||
return EC_SOCKET_CREATE;
|
||||
}
|
||||
|
||||
@@ -1726,7 +1726,7 @@ namespace GridMate
|
||||
if (!m_RIO_FN_TABLE.RIOSendEx(m_requestQueue, &m_RIOSendBuffer[m_workerNextSendBuffer],
|
||||
bufferCount, NULL, &m_RIOSendAddressBuffer[m_workerNextSendBuffer], NULL, NULL, 0, 0))
|
||||
{
|
||||
const DWORD lastError = ::WSAGetLastError();
|
||||
const DWORD lastError = GridMate::Platform::GetSocketError();
|
||||
if (lastError == WSAENOBUFS)
|
||||
{
|
||||
continue; //spin until free
|
||||
@@ -1836,7 +1836,7 @@ namespace GridMate
|
||||
if (false == m_RIO_FN_TABLE.RIOReceiveEx(m_requestQueue, &m_RIORecvBuffer[m_RIONextRecvBuffer],
|
||||
bufferCount, NULL, &m_RIORecvAddressBuffer[m_RIONextRecvBuffer], NULL, NULL, 0, 0))
|
||||
{
|
||||
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", ::WSAGetLastError());
|
||||
AZ_Error("GridMate", false, "Could not RIOReceive: %u\n", GridMate::Platform::GetSocketError());
|
||||
}
|
||||
|
||||
if (recvd)
|
||||
@@ -1867,7 +1867,7 @@ namespace GridMate
|
||||
{
|
||||
if (!WSAResetEvent(m_events[Index - WSA_WAIT_EVENT_0]))
|
||||
{
|
||||
AZ_Assert(false, "WSAResetEvent failed with error = %d\n", ::WSAGetLastError());
|
||||
AZ_Assert(false, "WSAResetEvent failed with error = %d\n", GridMate::Platform::GetSocketError());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1926,7 +1926,7 @@ namespace GridMate
|
||||
}
|
||||
else if (isFailed(Index))
|
||||
{
|
||||
AZ_Assert(false, "WSAWaitForMultipleEvents failed with error = %d\n", ::WSAGetLastError());
|
||||
AZ_Assert(false, "WSAWaitForMultipleEvents failed with error = %d\n", GridMate::Platform::GetSocketError());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -1945,7 +1945,7 @@ namespace GridMate
|
||||
{
|
||||
if (!SetEvent(m_events[WakeupOnSend])) //Wake thread
|
||||
{
|
||||
AZ_Assert(false, "SetEvent failed with error = %d\n", ::WSAGetLastError());
|
||||
AZ_Assert(false, "SetEvent failed with error = %d\n", GridMate::Platform::GetSocketError());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,6 @@
|
||||
#define MOBILE
|
||||
#endif
|
||||
|
||||
// Force all allocations to be aligned to TARGET_DEFAULT_ALIGN.
|
||||
// This is because malloc on Android 32 bit returns memory that is not aligned
|
||||
// to what some structs/classes need.
|
||||
#define CRY_FORCE_MALLOC_NEW_ALIGN
|
||||
|
||||
#define RC_EXECUTABLE "rc"
|
||||
#define USE_CRT 1
|
||||
#define SIZEOF_PTR 4
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Standard includes.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -120,10 +111,6 @@ typedef unsigned char byte;
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
|
||||
static type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
|
||||
const type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
// these functions do not exist int the wchar.h header
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
#pragma diagnostic ignore "-W#pragma-messages"
|
||||
#endif
|
||||
|
||||
|
||||
#define RC_EXECUTABLE "rc"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Standard includes.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -260,10 +257,6 @@ typedef uint64 __uint64;
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
|
||||
static type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
|
||||
const type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#define BST_UNCHECKED 0x0000
|
||||
|
||||
@@ -296,17 +289,6 @@ enum
|
||||
IDCONTINUE = 11
|
||||
};
|
||||
|
||||
#define ES_MULTILINE 0x0004L
|
||||
#define ES_AUTOVSCROLL 0x0040L
|
||||
#define ES_AUTOHSCROLL 0x0080L
|
||||
#define ES_WANTRETURN 0x1000L
|
||||
|
||||
#define LB_ERR (-1)
|
||||
|
||||
#define LB_ADDSTRING 0x0180
|
||||
#define LB_GETCOUNT 0x018B
|
||||
#define LB_SETTOPINDEX 0x0197
|
||||
|
||||
#define MB_OK 0x00000000L
|
||||
#define MB_OKCANCEL 0x00000001L
|
||||
#define MB_ABORTRETRYIGNORE 0x00000002L
|
||||
@@ -326,22 +308,16 @@ enum
|
||||
|
||||
#define MB_APPLMODAL 0x00000000L
|
||||
|
||||
#define MF_STRING 0x00000000L
|
||||
|
||||
#define MK_LBUTTON 0x0001
|
||||
#define MK_RBUTTON 0x0002
|
||||
#define MK_SHIFT 0x0004
|
||||
#define MK_CONTROL 0x0008
|
||||
#define MK_MBUTTON 0x0010
|
||||
|
||||
#define MK_ALT ( 0x20 )
|
||||
|
||||
#define SM_MOUSEPRESENT 0x00000000L
|
||||
|
||||
#define SM_CMOUSEBUTTONS 43
|
||||
|
||||
#define USER_TIMER_MINIMUM 0x0000000A
|
||||
|
||||
#define VK_TAB 0x09
|
||||
#define VK_SHIFT 0x10
|
||||
#define VK_MENU 0x12
|
||||
@@ -349,11 +325,6 @@ enum
|
||||
#define VK_SPACE 0x20
|
||||
#define VK_DELETE 0x2E
|
||||
|
||||
#define VK_NUMPAD1 0x61
|
||||
#define VK_NUMPAD2 0x62
|
||||
#define VK_NUMPAD3 0x63
|
||||
#define VK_NUMPAD4 0x64
|
||||
|
||||
#define VK_OEM_COMMA 0xBC // ',' any country
|
||||
#define VK_OEM_PERIOD 0xBE // '.' any country
|
||||
#define VK_OEM_3 0xC0 // '`~' for US
|
||||
@@ -496,36 +467,6 @@ typedef HANDLE HMENU;
|
||||
|
||||
#endif //__cplusplus
|
||||
|
||||
inline char* _fullpath(char* absPath, const char* relPath, size_t maxLength)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
if (realpath(relPath, path) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
const size_t len = std::min(strlen(path), maxLength - 1);
|
||||
memcpy(absPath, path, len);
|
||||
absPath[len] = 0;
|
||||
return absPath;
|
||||
}
|
||||
|
||||
typedef union _LARGE_INTEGER
|
||||
{
|
||||
struct
|
||||
{
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
};
|
||||
struct
|
||||
{
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
} u;
|
||||
|
||||
long long QuadPart;
|
||||
} LARGE_INTEGER;
|
||||
|
||||
extern bool QueryPerformanceCounter(LARGE_INTEGER*);
|
||||
extern bool QueryPerformanceFrequency(LARGE_INTEGER* frequency);
|
||||
|
||||
@@ -566,14 +507,6 @@ inline int closesocket(int s)
|
||||
return ::close(s);
|
||||
}
|
||||
|
||||
inline int WSAGetLastError()
|
||||
{
|
||||
return errno;
|
||||
}
|
||||
|
||||
//we take the definition of the pthread_t type directly from the pthread file
|
||||
#define THREADID_NULL 0
|
||||
|
||||
template <typename T, size_t N>
|
||||
char (*RtlpNumberOf( T (&)[N] ))[N];
|
||||
|
||||
|
||||
@@ -11,12 +11,9 @@
|
||||
#define CRYINCLUDE_CRYCOMMON_BASETYPES_H
|
||||
#pragma once
|
||||
|
||||
#include "CompileTimeAssert.h"
|
||||
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(char) == 1);
|
||||
COMPILE_TIME_ASSERT(sizeof(float) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(int) >= 4);
|
||||
static_assert(sizeof(char) == 1);
|
||||
static_assert(sizeof(float) == 4);
|
||||
static_assert(sizeof(int) >= 4);
|
||||
|
||||
|
||||
typedef unsigned char uchar;
|
||||
@@ -36,35 +33,35 @@ typedef signed long slong;
|
||||
typedef unsigned long long ulonglong;
|
||||
typedef signed long long slonglong;
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(uchar) == sizeof(schar));
|
||||
COMPILE_TIME_ASSERT(sizeof(ushort) == sizeof(sshort));
|
||||
COMPILE_TIME_ASSERT(sizeof(uint) == sizeof(sint));
|
||||
COMPILE_TIME_ASSERT(sizeof(ulong) == sizeof(slong));
|
||||
COMPILE_TIME_ASSERT(sizeof(ulonglong) == sizeof(slonglong));
|
||||
static_assert(sizeof(uchar) == sizeof(schar));
|
||||
static_assert(sizeof(ushort) == sizeof(sshort));
|
||||
static_assert(sizeof(uint) == sizeof(sint));
|
||||
static_assert(sizeof(ulong) == sizeof(slong));
|
||||
static_assert(sizeof(ulonglong) == sizeof(slonglong));
|
||||
|
||||
COMPILE_TIME_ASSERT(sizeof(uchar) <= sizeof(ushort));
|
||||
COMPILE_TIME_ASSERT(sizeof(ushort) <= sizeof(uint));
|
||||
COMPILE_TIME_ASSERT(sizeof(uint) <= sizeof(ulong));
|
||||
COMPILE_TIME_ASSERT(sizeof(ulong) <= sizeof(ulonglong));
|
||||
static_assert(sizeof(uchar) <= sizeof(ushort));
|
||||
static_assert(sizeof(ushort) <= sizeof(uint));
|
||||
static_assert(sizeof(uint) <= sizeof(ulong));
|
||||
static_assert(sizeof(ulong) <= sizeof(ulonglong));
|
||||
|
||||
|
||||
typedef schar int8;
|
||||
typedef schar sint8;
|
||||
typedef uchar uint8;
|
||||
COMPILE_TIME_ASSERT(sizeof(uint8) == 1);
|
||||
COMPILE_TIME_ASSERT(sizeof(sint8) == 1);
|
||||
static_assert(sizeof(uint8) == 1);
|
||||
static_assert(sizeof(sint8) == 1);
|
||||
|
||||
typedef sshort int16;
|
||||
typedef sshort sint16;
|
||||
typedef ushort uint16;
|
||||
COMPILE_TIME_ASSERT(sizeof(uint16) == 2);
|
||||
COMPILE_TIME_ASSERT(sizeof(sint16) == 2);
|
||||
static_assert(sizeof(uint16) == 2);
|
||||
static_assert(sizeof(sint16) == 2);
|
||||
|
||||
typedef sint int32;
|
||||
typedef sint sint32;
|
||||
typedef uint uint32;
|
||||
COMPILE_TIME_ASSERT(sizeof(uint32) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(sint32) == 4);
|
||||
static_assert(sizeof(uint32) == 4);
|
||||
static_assert(sizeof(sint32) == 4);
|
||||
|
||||
typedef slonglong int64;
|
||||
|
||||
@@ -72,14 +69,14 @@ typedef slonglong int64;
|
||||
#define O3DE_INT64_DEFINED
|
||||
typedef slonglong sint64;
|
||||
typedef ulonglong uint64;
|
||||
COMPILE_TIME_ASSERT(sizeof(uint64) == 8);
|
||||
COMPILE_TIME_ASSERT(sizeof(sint64) == 8);
|
||||
static_assert(sizeof(uint64) == 8);
|
||||
static_assert(sizeof(sint64) == 8);
|
||||
#endif
|
||||
|
||||
|
||||
typedef float f32;
|
||||
typedef double f64;
|
||||
COMPILE_TIME_ASSERT(sizeof(f32) == 4);
|
||||
COMPILE_TIME_ASSERT(sizeof(f64) == 8);
|
||||
static_assert(sizeof(f32) == 4);
|
||||
static_assert(sizeof(f64) == 8);
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_BASETYPES_H
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CompileTimeAssert.h"
|
||||
#include <AzCore/Casting/numeric_cast.h>
|
||||
|
||||
// Section dictionary
|
||||
@@ -188,45 +187,6 @@ ILINE int32 Isel32(int32 v, int32 alt)
|
||||
return ((static_cast<int32>(v) >> 31) & alt) | ((static_cast<int32>(~v) >> 31) & v);
|
||||
}
|
||||
|
||||
template <uint32 ILOG>
|
||||
struct CompileTimeIntegerLog2
|
||||
{
|
||||
static const uint32 result = 1 + CompileTimeIntegerLog2<(ILOG >> 1)>::result;
|
||||
};
|
||||
template <>
|
||||
struct CompileTimeIntegerLog2<1>
|
||||
{
|
||||
static const uint32 result = 0;
|
||||
};
|
||||
template <>
|
||||
struct CompileTimeIntegerLog2<0>; // keep it undefined, we cannot represent "minus infinity" result
|
||||
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<1>::result == 0);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<2>::result == 1);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<3>::result == 1);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<4>::result == 2);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<5>::result == 2);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<255>::result == 7);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<256>::result == 8);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2<257>::result == 8);
|
||||
|
||||
template <uint32 ILOG>
|
||||
struct CompileTimeIntegerLog2_RoundUp
|
||||
{
|
||||
static const uint32 result = CompileTimeIntegerLog2<ILOG>::result + ((ILOG & (ILOG - 1)) != 0);
|
||||
};
|
||||
template <>
|
||||
struct CompileTimeIntegerLog2_RoundUp<0>; // we can return 0, but let's keep it undefined (same as CompileTimeIntegerLog2<0>)
|
||||
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<1>::result == 0);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<2>::result == 1);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<3>::result == 2);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<4>::result == 2);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<5>::result == 3);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<255>::result == 8);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<256>::result == 8);
|
||||
COMPILE_TIME_ASSERT(CompileTimeIntegerLog2_RoundUp<257>::result == 9);
|
||||
|
||||
// Character-to-bitfield mapping
|
||||
|
||||
inline uint32 AlphaBit(char c)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
// Inspired by the Boost library's BOOST_STATIC_ASSERT(),
|
||||
// see http://www.boost.org/doc/libs/1_49_0/doc/html/boost_staticassert/how.html
|
||||
// or http://www.boost.org/libs/static_assert
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
|
||||
#define CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
|
||||
#pragma once
|
||||
|
||||
#if defined(__cplusplus)
|
||||
/*
|
||||
template <bool b>
|
||||
struct COMPILE_TIME_ASSERT_FAIL;
|
||||
|
||||
template <>
|
||||
struct COMPILE_TIME_ASSERT_FAIL<true>
|
||||
{
|
||||
};
|
||||
|
||||
template <int i>
|
||||
struct COMPILE_TIME_ASSERT_TEST
|
||||
{
|
||||
enum { dummy = i };
|
||||
};
|
||||
|
||||
#define COMPILE_TIME_ASSERT_BUILD_NAME2(x, y) x##y
|
||||
#define COMPILE_TIME_ASSERT_BUILD_NAME1(x, y) COMPILE_TIME_ASSERT_BUILD_NAME2(x, y)
|
||||
#define COMPILE_TIME_ASSERT_BUILD_NAME(x, y) COMPILE_TIME_ASSERT_BUILD_NAME1(x, y)
|
||||
|
||||
#ifndef __RECODE__
|
||||
#define COMPILE_TIME_ASSERT(expr) \
|
||||
typedef COMPILE_TIME_ASSERT_TEST<sizeof(COMPILE_TIME_ASSERT_FAIL<(bool)(expr)>)> \
|
||||
COMPILE_TIME_ASSERT_BUILD_NAME(compile_time_assert_test_, __LINE__)
|
||||
// note: for MS Visual Studio we could use __COUNTER__ instead of __LINE__
|
||||
#else
|
||||
#define COMPILE_TIME_ASSERT(expr)
|
||||
#endif // __RECODE__
|
||||
|
||||
#else
|
||||
|
||||
#define COMPILE_TIME_ASSERT(expr)
|
||||
*/
|
||||
#endif
|
||||
|
||||
#define COMPILE_TIME_ASSERT_MSG(expr, msg) static_assert(expr, msg)
|
||||
#define COMPILE_TIME_ASSERT(expr) COMPILE_TIME_ASSERT_MSG(expr, "Compile Time Assert")
|
||||
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_COMPILETIMEASSERT_H
|
||||
@@ -771,7 +771,7 @@ namespace NArray
|
||||
|
||||
AP& allocator()
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(AP) == sizeof(A));
|
||||
static_assert(sizeof(AP) == sizeof(A));
|
||||
return *(AP*)this;
|
||||
}
|
||||
const AP& allocator() const
|
||||
|
||||
@@ -708,8 +708,8 @@ protected:
|
||||
|
||||
static inline S FromFloat(float fIn)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(S) <= 4);
|
||||
COMPILE_TIME_ASSERT(nEXP_BITS > 0 && nEXP_BITS <= 8 && nEXP_BITS < sizeof(S) * 8 - 4);
|
||||
static_assert(sizeof(S) <= 4);
|
||||
static_assert(nEXP_BITS > 0 && nEXP_BITS <= 8 && nEXP_BITS < sizeof(S) * 8 - 4);
|
||||
|
||||
// Clamp to allowed range.
|
||||
float fClamped = clamp_tpl(fIn * fROUNDER(), fMIN(), fMAX());
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#ifdef MAX_SUB_MATERIALS
|
||||
// This checks that the values are in sync in the different files.
|
||||
COMPILE_TIME_ASSERT(MAX_SUB_MATERIALS == 128);
|
||||
static_assert(MAX_SUB_MATERIALS == 128);
|
||||
#else
|
||||
#define MAX_SUB_MATERIALS 128
|
||||
#endif
|
||||
|
||||
@@ -63,7 +63,6 @@ using DetachEnvironmentFunction = void(*)();
|
||||
#if !defined(WIN32_LEAN_AND_MEAN)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <CryWindows.h>
|
||||
|
||||
HMODULE CryLoadLibrary(const char* libName);
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <limits> // std::numeric_limits
|
||||
#include <type_traits> // std::make_unsigned
|
||||
#include "BaseTypes.h" // uint32, uint64
|
||||
#include "CompileTimeAssert.h"
|
||||
#include "Cry_Vector2.h"
|
||||
#include "Cry_Vector3.h"
|
||||
#include "Cry_Vector4.h"
|
||||
@@ -24,10 +23,10 @@ namespace CryRandom_Internal
|
||||
template <class R, class T, size_t size>
|
||||
struct BoundedRandomUint
|
||||
{
|
||||
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
|
||||
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_signed);
|
||||
COMPILE_TIME_ASSERT(sizeof(T) == size);
|
||||
COMPILE_TIME_ASSERT(sizeof(T) <= sizeof(uint32));
|
||||
static_assert(std::numeric_limits<T>::is_integer);
|
||||
static_assert(!std::numeric_limits<T>::is_signed);
|
||||
static_assert(sizeof(T) == size);
|
||||
static_assert(sizeof(T) <= sizeof(uint32));
|
||||
|
||||
inline static T Get(R& randomGenerator, const T maxValue)
|
||||
{
|
||||
@@ -41,9 +40,9 @@ namespace CryRandom_Internal
|
||||
template <class R, class T>
|
||||
struct BoundedRandomUint<R, T, 8>
|
||||
{
|
||||
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
|
||||
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_signed);
|
||||
COMPILE_TIME_ASSERT(sizeof(T) == sizeof(uint64));
|
||||
static_assert(std::numeric_limits<T>::is_integer);
|
||||
static_assert(!std::numeric_limits<T>::is_signed);
|
||||
static_assert(sizeof(T) == sizeof(uint64));
|
||||
|
||||
inline static T Get(R& randomGenerator, const T maxValue)
|
||||
{
|
||||
@@ -65,11 +64,11 @@ namespace CryRandom_Internal
|
||||
template <class R, class T>
|
||||
struct BoundedRandom<R, T, true>
|
||||
{
|
||||
COMPILE_TIME_ASSERT(std::numeric_limits<T>::is_integer);
|
||||
static_assert(std::numeric_limits<T>::is_integer);
|
||||
typedef typename std::make_unsigned<T>::type UT;
|
||||
COMPILE_TIME_ASSERT(sizeof(T) == sizeof(UT));
|
||||
COMPILE_TIME_ASSERT(std::numeric_limits<UT>::is_integer);
|
||||
COMPILE_TIME_ASSERT(!std::numeric_limits<UT>::is_signed);
|
||||
static_assert(sizeof(T) == sizeof(UT));
|
||||
static_assert(std::numeric_limits<UT>::is_integer);
|
||||
static_assert(!std::numeric_limits<UT>::is_signed);
|
||||
|
||||
inline static T Get(R& randomGenerator, T minValue, T maxValue)
|
||||
{
|
||||
@@ -84,7 +83,7 @@ namespace CryRandom_Internal
|
||||
template <class R, class T>
|
||||
struct BoundedRandom<R, T, false>
|
||||
{
|
||||
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_integer);
|
||||
static_assert(!std::numeric_limits<T>::is_integer);
|
||||
|
||||
inline static T Get(R& randomGenerator, const T minValue, const T maxValue)
|
||||
{
|
||||
@@ -139,7 +138,7 @@ namespace CryRandom_Internal
|
||||
inline VT GetRandomUnitVector(R& randomGenerator)
|
||||
{
|
||||
typedef typename VT::value_type T;
|
||||
COMPILE_TIME_ASSERT(!std::numeric_limits<T>::is_integer);
|
||||
static_assert(!std::numeric_limits<T>::is_integer);
|
||||
|
||||
VT res;
|
||||
T lenSquared;
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Contributors to the Open 3D Engine Project.
|
||||
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// Description : Specific header to handle Windows.h include
|
||||
|
||||
|
||||
#ifndef CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
|
||||
#define CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
|
||||
#pragma once
|
||||
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_CRYWINDOWS_H
|
||||
@@ -41,7 +41,7 @@ struct IRenderMesh;
|
||||
|
||||
#ifdef MAX_SUB_MATERIALS
|
||||
// This checks that the values are in sync in the different files.
|
||||
COMPILE_TIME_ASSERT(MAX_SUB_MATERIALS == 128);
|
||||
static_assert(MAX_SUB_MATERIALS == 128);
|
||||
#else
|
||||
#define MAX_SUB_MATERIALS 128
|
||||
#endif
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#endif
|
||||
|
||||
#include "CryAssert.h"
|
||||
#include "CompileTimeAssert.h"
|
||||
|
||||
#include <AzCore/IO/SystemFile.h>
|
||||
|
||||
@@ -1428,10 +1427,10 @@ namespace Detail
|
||||
# define DeclareConstIntCVar(name, defaultValue) enum : int { name = (defaultValue) }
|
||||
# define DeclareStaticConstIntCVar(name, defaultValue) enum : int { name = (defaultValue) }
|
||||
|
||||
# define DefineConstIntCVarName(strname, name, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, strname, defaultValue); }
|
||||
# define DefineConstIntCVar(name, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, (#name), defaultValue); }
|
||||
# define DefineConstIntCVarName(strname, name, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, strname, defaultValue); }
|
||||
# define DefineConstIntCVar(name, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(name)); REGISTER_DUMMY_CVAR(int, (#name), defaultValue); }
|
||||
// DefineConstIntCVar2 is deprecated, any such instance can be converted to the 3 variant by removing the quotes around the first parameter
|
||||
# define DefineConstIntCVar3(name, _var_, defaultValue, flags, help) { COMPILE_TIME_ASSERT((int)(defaultValue) == (int)(_var_)); REGISTER_DUMMY_CVAR(int, name, defaultValue); }
|
||||
# define DefineConstIntCVar3(name, _var_, defaultValue, flags, help) { static_assert((int)(defaultValue) == (int)(_var_)); REGISTER_DUMMY_CVAR(int, name, defaultValue); }
|
||||
# define AllocateConstIntCVar(scope, name)
|
||||
|
||||
# define DefineConstFloatCVar(name, flags, help) { REGISTER_DUMMY_CVAR(float, (#name), name ## Default); }
|
||||
@@ -1543,33 +1542,33 @@ static void AssertConsoleExists(void)
|
||||
#define ILLEGAL_DEV_FLAGS (VF_NET_SYNCED | VF_CHEAT | VF_CHEAT_ALWAYS_CHECK | VF_CHEAT_NOCHECK | VF_READONLY | VF_CONST_CVAR)
|
||||
|
||||
#if defined(_RELEASE)
|
||||
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val /* _onchangefunction consumed; callback not available */
|
||||
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
|
||||
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
|
||||
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val /* _onchangefunction consumed; callback not available */
|
||||
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0) /* consumed; pure cvar not available */
|
||||
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
|
||||
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); *(_var) = _def_val
|
||||
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) NULL; static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0); _var = _def_val
|
||||
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) /* consumed; command not available */
|
||||
#else
|
||||
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEV_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_DEV_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_CB_DEV_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT64_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_FLOAT_DEV_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_DEV_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_CB_DEV_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEV_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_COMMAND_DEV_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEV_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#endif // defined(_RELEASE)
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1586,19 +1585,19 @@ static void AssertConsoleExists(void)
|
||||
// TODO Registering all cvars for Dedicated server as well. Currently CrySystems have no concept of Dedicated server with cmake.
|
||||
// If we introduce server specific targets for CrySystems, we can add DEDICATED_SERVER flags to those and add the flag back in here.
|
||||
#if defined(_RELEASE)
|
||||
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT64_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_FLOAT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_COMMAND_DEDI_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEDI_ONLY), _comment); COMPILE_TIME_ASSERT(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_STRING(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_STRING_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_STRING_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT_CB_DEDI_ONLY(_name, _def_val, _flags, _comment, _onchangefunction) REGISTER_INT_CB(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_INT64_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_INT64(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_FLOAT_DEDI_ONLY(_name, _def_val, _flags, _comment) REGISTER_FLOAT(_name, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR2(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR2_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR2_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_DEDI_ONLY(_name, _var, _def_val, _flags, _comment) REGISTER_CVAR3(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_CVAR3_CB_DEDI_ONLY(_name, _var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR3_CB(_name, _var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#define REGISTER_COMMAND_DEDI_ONLY(_name, _func, _flags, _comment) REGISTER_COMMAND(_name, _func, ((_flags) | VF_DEDI_ONLY), _comment); static_assert(((_flags) & ILLEGAL_DEV_FLAGS) == 0)
|
||||
#else
|
||||
#define REGISTER_CVAR_DEDI_ONLY(_var, _def_val, _flags, _comment) REGISTER_CVAR_DEV_ONLY(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment)
|
||||
#define REGISTER_CVAR_CB_DEDI_ONLY(_var, _def_val, _flags, _comment, _onchangefunction) REGISTER_CVAR_CB_DEV_ONLY(_var, _def_val, ((_flags) | VF_DEDI_ONLY), _comment, _onchangefunction)
|
||||
|
||||
@@ -314,8 +314,8 @@ public:
|
||||
|
||||
void GetMemoryUsage([[maybe_unused]] ICrySizer* pSizer) const
|
||||
{
|
||||
COMPILE_TIME_ASSERT(eTT_MaxTexType <= 255);
|
||||
COMPILE_TIME_ASSERT(eTF_MaxFormat <= 255);
|
||||
static_assert(eTT_MaxTexType <= 255);
|
||||
static_assert(eTF_MaxFormat <= 255);
|
||||
/*LATER*/
|
||||
}
|
||||
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
#define _CPU_X86
|
||||
//#define _CPU_SSE
|
||||
|
||||
#define RC_EXECUTABLE "rc"
|
||||
#define USE_CRT 1
|
||||
#define SIZEOF_PTR 4
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Standard includes.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -97,10 +93,6 @@ typedef unsigned char byte;
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
|
||||
static type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
|
||||
const type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
|
||||
|
||||
@@ -20,10 +20,6 @@
|
||||
#define _CPU_AMD64
|
||||
#define _CPU_SSE
|
||||
|
||||
#define RC_EXECUTABLE "rc"
|
||||
#define USE_CRT 1
|
||||
#define SIZEOF_PTR 8
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Standard includes.
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
@@ -103,10 +99,6 @@ typedef uint8 byte;
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) \
|
||||
type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) \
|
||||
static type __attribute__ ((aligned(alignment))) name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) \
|
||||
const type __attribute__ ((aligned(alignment))) name;
|
||||
|
||||
#include "LinuxSpecific.h"
|
||||
|
||||
|
||||
@@ -182,7 +182,6 @@ typedef int64 __int64;
|
||||
typedef uint64 __uint64;
|
||||
#endif
|
||||
|
||||
#define THREADID_NULL -1
|
||||
typedef unsigned long int threadID;
|
||||
|
||||
#define TRUE 1
|
||||
@@ -213,27 +212,6 @@ typedef unsigned long int threadID;
|
||||
|
||||
#define _wtof(str) wcstod(str, 0)
|
||||
|
||||
/*static unsigned char toupper(unsigned char c)
|
||||
{
|
||||
return c & ~0x40;
|
||||
}
|
||||
*/
|
||||
typedef union _LARGE_INTEGER
|
||||
{
|
||||
struct
|
||||
{
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
};
|
||||
struct
|
||||
{
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
} u;
|
||||
long long QuadPart;
|
||||
} LARGE_INTEGER;
|
||||
|
||||
|
||||
// stdlib.h stuff
|
||||
#define _MAX_DRIVE 3 // max. length of drive component
|
||||
#define _MAX_DIR 256 // max. length of path component
|
||||
@@ -257,21 +235,6 @@ typedef union _LARGE_INTEGER
|
||||
#define _O_SEQUENTIAL 0x0020 /* file access is primarily sequential */
|
||||
#define _O_RANDOM 0x0010 /* file access is primarily random */
|
||||
|
||||
// curses.h stubs for PDcurses keys
|
||||
#define PADENTER KEY_MAX + 1
|
||||
#define CTL_HOME KEY_MAX + 2
|
||||
#define CTL_END KEY_MAX + 3
|
||||
#define CTL_PGDN KEY_MAX + 4
|
||||
#define CTL_PGUP KEY_MAX + 5
|
||||
|
||||
// stubs for virtual keys, isn't used on Linux
|
||||
#define VK_UP 0
|
||||
#define VK_DOWN 0
|
||||
#define VK_RIGHT 0
|
||||
#define VK_LEFT 0
|
||||
#define VK_CONTROL 0
|
||||
#define VK_SCROLL 0
|
||||
|
||||
enum
|
||||
{
|
||||
IDOK = 1,
|
||||
@@ -285,17 +248,6 @@ enum
|
||||
IDCONTINUE = 11
|
||||
};
|
||||
|
||||
#define ES_MULTILINE 0x0004L
|
||||
#define ES_AUTOVSCROLL 0x0040L
|
||||
#define ES_AUTOHSCROLL 0x0080L
|
||||
#define ES_WANTRETURN 0x1000L
|
||||
|
||||
#define LB_ERR (-1)
|
||||
|
||||
#define LB_ADDSTRING 0x0180
|
||||
#define LB_GETCOUNT 0x018B
|
||||
#define LB_SETTOPINDEX 0x0197
|
||||
|
||||
#define MB_OK 0x00000000L
|
||||
#define MB_OKCANCEL 0x00000001L
|
||||
#define MB_ABORTRETRYIGNORE 0x00000002L
|
||||
@@ -315,22 +267,16 @@ enum
|
||||
|
||||
#define MB_APPLMODAL 0x00000000L
|
||||
|
||||
#define MF_STRING 0x00000000L
|
||||
|
||||
#define MK_LBUTTON 0x0001
|
||||
#define MK_RBUTTON 0x0002
|
||||
#define MK_SHIFT 0x0004
|
||||
#define MK_CONTROL 0x0008
|
||||
#define MK_MBUTTON 0x0010
|
||||
|
||||
#define MK_ALT ( 0x20 )
|
||||
|
||||
#define SM_MOUSEPRESENT 0x00000000L
|
||||
|
||||
#define SM_CMOUSEBUTTONS 43
|
||||
|
||||
#define USER_TIMER_MINIMUM 0x0000000A
|
||||
|
||||
#define VK_TAB 0x09
|
||||
#define VK_SHIFT 0x10
|
||||
#define VK_MENU 0x12
|
||||
@@ -338,11 +284,6 @@ enum
|
||||
#define VK_SPACE 0x20
|
||||
#define VK_DELETE 0x2E
|
||||
|
||||
#define VK_NUMPAD1 0x61
|
||||
#define VK_NUMPAD2 0x62
|
||||
#define VK_NUMPAD3 0x63
|
||||
#define VK_NUMPAD4 0x64
|
||||
|
||||
#define VK_OEM_COMMA 0xBC // ',' any country
|
||||
#define VK_OEM_PERIOD 0xBE // '.' any country
|
||||
#define VK_OEM_3 0xC0 // '`~' for US
|
||||
@@ -529,36 +470,11 @@ inline int64 CryGetTicksPerSec()
|
||||
|
||||
inline int _CrtCheckMemory() { return 1; };
|
||||
|
||||
inline char* _fullpath(char* absPath, const char* relPath, size_t maxLength)
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
if (realpath(relPath, path) == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
const size_t len = std::min(strlen(path), maxLength - 1);
|
||||
memcpy(absPath, path, len);
|
||||
absPath[len] = 0;
|
||||
return absPath;
|
||||
}
|
||||
|
||||
typedef void* HGLRC;
|
||||
typedef void* HDC;
|
||||
typedef void* PROC;
|
||||
typedef void* PIXELFORMATDESCRIPTOR;
|
||||
|
||||
#define SCOPED_ENABLE_FLOAT_EXCEPTIONS
|
||||
|
||||
// Linux_Win32Wrapper.h now included directly by platform.h
|
||||
//#include "Linux_Win32Wrapper.h"
|
||||
|
||||
#define closesocket close
|
||||
inline int WSAGetLastError()
|
||||
{
|
||||
return errno;
|
||||
}
|
||||
|
||||
template <typename T, size_t N>
|
||||
char (*RtlpNumberOf( T (&)[N] ))[N];
|
||||
|
||||
|
||||
@@ -490,8 +490,6 @@ extern void adaptFilenameToLinux(char* rAdjustedFilename);
|
||||
extern const int comparePathNames(const char* cpFirst, const char* cpSecond, unsigned int len);//returns 0 if identical
|
||||
extern void replaceDoublePathFilename(char* szFileName);//removes "\.\" to "\" and "/./" to "/"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
extern char* _fullpath(char* absPath, const char* relPath, size_t maxLength);
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
extern void _makepath(char* path, const char* drive, const char* dir, const char* filename, const char* ext);
|
||||
|
||||
|
||||
@@ -24,40 +24,6 @@
|
||||
#define _CPU_SSE
|
||||
#define PLATFORM_64BIT
|
||||
|
||||
#define USE_CRT 1
|
||||
#define SIZEOF_PTR 8
|
||||
|
||||
typedef uint64_t threadID;
|
||||
|
||||
|
||||
// curses.h stubs for PDcurses keys
|
||||
#define PADENTER KEY_MAX + 1
|
||||
#define CTL_HOME KEY_MAX + 2
|
||||
#define CTL_END KEY_MAX + 3
|
||||
#define CTL_PGDN KEY_MAX + 4
|
||||
#define CTL_PGUP KEY_MAX + 5
|
||||
|
||||
// stubs for virtual keys, isn't used on Mac
|
||||
#define VK_UP 0
|
||||
#define VK_DOWN 0
|
||||
#define VK_RIGHT 0
|
||||
#define VK_LEFT 0
|
||||
#define VK_CONTROL 0
|
||||
#define VK_SCROLL 0
|
||||
|
||||
#define MAC_NOT_IMPLEMENTED assert(false);
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eDAContinue,
|
||||
eDAIgnore,
|
||||
eDAIgnoreAll,
|
||||
eDABreak,
|
||||
eDAStop,
|
||||
eDAReportAsBug
|
||||
} EDialogAction;
|
||||
|
||||
extern EDialogAction MacOSXHandleAssert(const char* condition, const char* file, int line, const char* reason, bool);
|
||||
|
||||
#endif // CRYINCLUDE_CRYCOMMON_MACSPECIFIC_H
|
||||
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
typedef Struc TThis; typedef Int TInt; \
|
||||
TInt Mask() const { return *(const TInt*)this; } \
|
||||
TInt& Mask() { return *(TInt*)this; } \
|
||||
Struc(TInt init = 0) { COMPILE_TIME_ASSERT(sizeof(TThis) == sizeof(TInt)); Mask() = init; } \
|
||||
Struc(TInt init = 0) { static_assert(sizeof(TThis) == sizeof(TInt)); Mask() = init; } \
|
||||
|
||||
#define BIT_VAR(Var) \
|
||||
TInt _##Var : 1; \
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace CryStringUtils_Internal
|
||||
template <class TChar>
|
||||
inline bool strcpy_with_clamp(TChar* const dst, size_t const dst_size_in_bytes, const TChar* const src, size_t const src_size_in_bytes)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(wchar_t));
|
||||
static_assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(wchar_t));
|
||||
|
||||
if (!dst || dst_size_in_bytes < sizeof(TChar))
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace CryStringUtils_Internal
|
||||
template <class TChar>
|
||||
inline bool strcat_with_clamp(TChar* const dst, size_t const dst_size_in_bytes, const TChar* const src, size_t const src_size_in_bytes)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(wchar_t));
|
||||
static_assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(wchar_t));
|
||||
|
||||
if (!dst || dst_size_in_bytes < sizeof(TChar))
|
||||
{
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace Unicode
|
||||
>::type
|
||||
>::type CharType;
|
||||
static const size_t FixedSize = extent<T>::value;
|
||||
COMPILE_TIME_ASSERT(!is_array<T>::value || FixedSize > 0);
|
||||
static_assert(!is_array<T>::value || FixedSize > 0);
|
||||
static const bool isConstArray = is_array<T>::value && is_const<typename remove_extent<T>::type>::value;
|
||||
static const bool isBufferArray = is_array<T>::value && !isConstArray;
|
||||
static const bool isPointer = is_pointer<T>::value;
|
||||
@@ -393,7 +393,7 @@ namespace Unicode
|
||||
sizeof(CharType) == 1 ? eEncoding_UTF8 :
|
||||
sizeof(CharType) == 2 ? eEncoding_UTF16 :
|
||||
eEncoding_UTF32;
|
||||
COMPILE_TIME_ASSERT(value != eEncoding_UTF32 || sizeof(CharType) == 4);
|
||||
static_assert(value != eEncoding_UTF32 || sizeof(CharType) == 4);
|
||||
};
|
||||
|
||||
// SBindCharacter<T, Input>:
|
||||
@@ -408,7 +408,7 @@ namespace Unicode
|
||||
template<typename T, bool Input>
|
||||
struct SBindCharacter<T, Input, false, false>
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_arithmetic<T>::value);
|
||||
static_assert(is_arithmetic<T>::value);
|
||||
typedef typename remove_cv<T>::type UnqualifiedType;
|
||||
typedef typename conditional<Input, const UnqualifiedType, UnqualifiedType>::type type;
|
||||
};
|
||||
@@ -417,7 +417,7 @@ namespace Unicode
|
||||
{
|
||||
typedef typename conditional<Input, const uint16, uint16>::type type;
|
||||
typedef typename SDependentType<QChar, Input>::type ActuallyQChar; // Force two-phase name lookup on QChar.
|
||||
COMPILE_TIME_ASSERT(sizeof(ActuallyQChar) == sizeof(type)); // In case Qt ever changes QChar.
|
||||
static_assert(sizeof(ActuallyQChar) == sizeof(type)); // In case Qt ever changes QChar.
|
||||
};
|
||||
|
||||
// SBindPointer<T, Input>:
|
||||
@@ -425,7 +425,7 @@ namespace Unicode
|
||||
template<typename T, bool Input>
|
||||
struct SBindPointer
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_pointer<T>::value || is_array<T>::value);
|
||||
static_assert(is_pointer<T>::value || is_array<T>::value);
|
||||
typedef typename conditional<
|
||||
is_pointer<T>::value,
|
||||
typename remove_pointer<T>::type,
|
||||
@@ -458,8 +458,8 @@ namespace Unicode
|
||||
{
|
||||
// Allow casts from pointer-to-integral to unrelated pointer-to-integral, provided they are of the same size.
|
||||
typedef typename remove_pointer<T>::type TargetChar;
|
||||
COMPILE_TIME_ASSERT(is_integral<SourceChar>::value && is_integral<TargetChar>::value);
|
||||
COMPILE_TIME_ASSERT(sizeof(SourceChar) == sizeof(TargetChar));
|
||||
static_assert(is_integral<SourceChar>::value && is_integral<TargetChar>::value);
|
||||
static_assert(sizeof(SourceChar) == sizeof(TargetChar));
|
||||
return reinterpret_cast<T>(ptr);
|
||||
}
|
||||
template<typename T, typename SourceChar>
|
||||
@@ -467,8 +467,8 @@ namespace Unicode
|
||||
{
|
||||
// Allow casts from pointer-to-QChar to unrelated pointer-to-integral, provided they are of the same size.
|
||||
typedef typename remove_pointer<T>::type TargetChar;
|
||||
COMPILE_TIME_ASSERT(is_integral<TargetChar>::value);
|
||||
COMPILE_TIME_ASSERT(sizeof(SourceChar) == sizeof(TargetChar));
|
||||
static_assert(is_integral<TargetChar>::value);
|
||||
static_assert(sizeof(SourceChar) == sizeof(TargetChar));
|
||||
return reinterpret_cast<T>(ptr);
|
||||
}
|
||||
template<typename T, typename SourceChar>
|
||||
@@ -612,7 +612,7 @@ namespace Unicode
|
||||
template<typename InputStringType, typename Sink>
|
||||
inline void Feed(const InputStringType& in, Sink& out, integral_constant<EBind, eBind_Literal>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
typedef typename SBindPointer<InputStringType, true>::type PointerType;
|
||||
const size_t length = extent<InputStringType>::value - 1;
|
||||
PointerType ptr = SafeCast<PointerType>(in);
|
||||
@@ -630,7 +630,7 @@ namespace Unicode
|
||||
template<typename InputStringType, typename Sink>
|
||||
inline void Feed(const InputStringType& in, Sink& out, integral_constant<EBind, eBind_Buffer>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
typedef typename SBindPointer<InputStringType, true>::type PointerType;
|
||||
typedef typename SBindPointer<InputStringType, true>::BoundCharType CharType;
|
||||
const size_t length = extent<InputStringType>::value;
|
||||
@@ -652,7 +652,7 @@ namespace Unicode
|
||||
template<typename InputStringType, typename Sink>
|
||||
inline void Feed(const InputStringType& in, Sink& out, integral_constant<EBind, eBind_NullTerminated>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_pointer<InputStringType>::value);
|
||||
static_assert(is_pointer<InputStringType>::value);
|
||||
typedef typename SBindPointer<InputStringType, true>::type PointerType;
|
||||
typedef typename SBindPointer<InputStringType, true>::BoundCharType CharType;
|
||||
PointerType ptr = SafeCast<PointerType>(in);
|
||||
@@ -677,7 +677,7 @@ namespace Unicode
|
||||
template<typename InputCharType, typename Sink>
|
||||
inline void Feed(const InputCharType& in, Sink& out, integral_constant<EBind, eBind_CodePoint>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_arithmetic<InputCharType>::value);
|
||||
static_assert(is_arithmetic<InputCharType>::value);
|
||||
const uint32 item = static_cast<uint32>(in);
|
||||
out(item);
|
||||
}
|
||||
@@ -711,7 +711,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline size_t EncodedLength(const InputStringType& in, integral_constant<EBind, eBind_Literal>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
return extent<InputStringType>::value - 1;
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline size_t EncodedLength(const InputStringType& in, integral_constant<EBind, eBind_Buffer>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
typedef typename remove_extent<InputStringType>::type CharType;
|
||||
return SCharacterTrait<CharType>::StrNLen(in, extent<InputStringType>::value);
|
||||
}
|
||||
@@ -738,7 +738,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline size_t EncodedLength(const InputStringType& in, integral_constant<EBind, eBind_NullTerminated>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_pointer<InputStringType>::value);
|
||||
static_assert(is_pointer<InputStringType>::value);
|
||||
typedef typename remove_pointer<InputStringType>::type CharType;
|
||||
return in ? SCharacterTrait<CharType>::StrLen(in) : 0;
|
||||
}
|
||||
@@ -748,7 +748,7 @@ namespace Unicode
|
||||
template<typename InputCharType>
|
||||
inline size_t EncodedLength([[maybe_unused]] const InputCharType& in, integral_constant<EBind, eBind_CodePoint>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_arithmetic<InputCharType>::value);
|
||||
static_assert(is_arithmetic<InputCharType>::value);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -775,7 +775,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline const void* EncodedPointer(const InputStringType& in, integral_constant<EBind, eBind_Literal>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
return in; // We can just let the array type decay to a pointer.
|
||||
}
|
||||
|
||||
@@ -784,7 +784,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline const void* EncodedPointer(const InputStringType& in, integral_constant<EBind, eBind_Buffer>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
static_assert(is_array<InputStringType>::value && extent<InputStringType>::value > 0);
|
||||
return in; // We can just let the array type decay to a pointer.
|
||||
}
|
||||
|
||||
@@ -793,7 +793,7 @@ namespace Unicode
|
||||
template<typename InputStringType>
|
||||
inline const void* EncodedPointer(const InputStringType& in, integral_constant<EBind, eBind_NullTerminated>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_pointer<InputStringType>::value);
|
||||
static_assert(is_pointer<InputStringType>::value);
|
||||
return in; // Implied
|
||||
}
|
||||
|
||||
@@ -802,7 +802,7 @@ namespace Unicode
|
||||
template<typename InputCharType>
|
||||
inline const void* EncodedPointer(const InputCharType& in, integral_constant<EBind, eBind_CodePoint>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(is_arithmetic<InputCharType>::value);
|
||||
static_assert(is_arithmetic<InputCharType>::value);
|
||||
return ∈ // Take the address of the parameter (which is kept on the stack of the caller).
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "BaseTypes.h" // For uint8, uint16, uint32
|
||||
#include "CompileTimeAssert.h" // For COMPILE_TIME_ASSERT macro
|
||||
|
||||
namespace Unicode
|
||||
{
|
||||
// Supported encoding/conversion types.
|
||||
@@ -631,7 +631,7 @@ namespace Unicode
|
||||
struct SRecoveryFallbackHelper
|
||||
{
|
||||
// A compilation error here means RecoveryMethod value was unexpected here
|
||||
COMPILE_TIME_ASSERT(
|
||||
static_assert(
|
||||
RecoveryMethod == eErrorRecovery_FallbackLatin1ThenDiscard ||
|
||||
RecoveryMethod == eErrorRecovery_FallbackLatin1ThenReplace ||
|
||||
RecoveryMethod == eErrorRecovery_FallbackWin1252ThenDiscard ||
|
||||
|
||||
@@ -266,7 +266,7 @@ namespace Unicode
|
||||
inline size_t LengthSafe(const InputStringType& source)
|
||||
{
|
||||
// SRequire a safe recovery method.
|
||||
COMPILE_TIME_ASSERT(SIsSafeEncoding<Recovery>::value);
|
||||
static_assert(SIsSafeEncoding<Recovery>::value);
|
||||
|
||||
// Bind methods.
|
||||
const EBind bindMethod = SBindObject<InputStringType, false>::value;
|
||||
@@ -379,7 +379,7 @@ namespace Unicode
|
||||
inline size_t ConvertSafe(OutputStringType& target, const InputStringType& source)
|
||||
{
|
||||
// SRequire a safe recovery method.
|
||||
COMPILE_TIME_ASSERT(SIsSafeEncoding<Recovery>::value);
|
||||
static_assert(SIsSafeEncoding<Recovery>::value);
|
||||
|
||||
// Bind methods.
|
||||
const EBind inputBindMethod = SBindObject<InputStringType, false>::value;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Unicode
|
||||
template<typename BaseIterator, typename BoundsChecker, EEncoding Encoding>
|
||||
inline void MoveNext(BaseIterator& it, const BoundsChecker& checker, const integral_constant<EEncoding, Encoding>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(
|
||||
static_assert(
|
||||
Encoding == eEncoding_ASCII ||
|
||||
Encoding == eEncoding_UTF32 ||
|
||||
Encoding == eEncoding_Latin1 ||
|
||||
@@ -88,7 +88,7 @@ namespace Unicode
|
||||
template<typename BaseIterator, typename BoundsChecker, EEncoding Encoding>
|
||||
inline void MovePrev(BaseIterator& it, const BoundsChecker& checker, const integral_constant<EEncoding, Encoding>)
|
||||
{
|
||||
COMPILE_TIME_ASSERT(
|
||||
static_assert(
|
||||
Encoding == eEncoding_ASCII ||
|
||||
Encoding == eEncoding_UTF32 ||
|
||||
Encoding == eEncoding_Latin1 ||
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
#define ILINE __forceinline
|
||||
#endif
|
||||
|
||||
#define RC_EXECUTABLE "rc.exe"
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define TYPENAME(x) typeid(x).name()
|
||||
#define SIZEOF_PTR 4
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x501
|
||||
@@ -54,8 +51,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#include "BaseTypes.h"
|
||||
|
||||
#define THREADID_NULL -1
|
||||
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned int threadID;
|
||||
typedef unsigned long DWORD;
|
||||
@@ -111,14 +106,11 @@ int64 CryGetTicksPerSec();
|
||||
__declspec(align(num))
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) static _declspec(align(alignment)) type name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) const _declspec(align(alignment)) type name;
|
||||
|
||||
#ifndef FILE_ATTRIBUTE_NORMAL
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
#endif
|
||||
|
||||
#define FP16_TERRAIN
|
||||
#define TARGET_DEFAULT_ALIGN (0x4U)
|
||||
|
||||
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
#define _CPU_SSE
|
||||
#define ILINE __forceinline
|
||||
|
||||
#define RC_EXECUTABLE "rc.exe"
|
||||
#define DEPRECATED __declspec(deprecated)
|
||||
#define TYPENAME(x) typeid(x).name()
|
||||
#define SIZEOF_PTR 8
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
# define _WIN32_WINNT 0x501
|
||||
@@ -51,7 +48,6 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
#include "BaseTypes.h"
|
||||
|
||||
#define THREADID_NULL -1
|
||||
typedef long LONG;
|
||||
typedef unsigned char BYTE;
|
||||
typedef unsigned long threadID;
|
||||
@@ -93,10 +89,6 @@ int64 CryGetTicksPerSec();
|
||||
__declspec(align(num))
|
||||
|
||||
#define DEFINE_ALIGNED_DATA(type, name, alignment) _declspec(align(alignment)) type name;
|
||||
#define DEFINE_ALIGNED_DATA_STATIC(type, name, alignment) static _declspec(align(alignment)) type name;
|
||||
#define DEFINE_ALIGNED_DATA_CONST(type, name, alignment) const _declspec(align(alignment)) type name;
|
||||
|
||||
#define SIZEOF_PTR 8
|
||||
|
||||
#ifndef FILE_ATTRIBUTE_NORMAL
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x00000080
|
||||
|
||||
@@ -68,7 +68,6 @@ set(FILES
|
||||
LCGRandom.h
|
||||
CryTypeInfo.cpp
|
||||
BaseTypes.h
|
||||
CompileTimeAssert.h
|
||||
MemoryAccess.h
|
||||
AnimKey.h
|
||||
BitFiddling.h
|
||||
@@ -165,7 +164,6 @@ set(FILES
|
||||
CryThread_windows.h
|
||||
CryThreadImpl_pthreads.h
|
||||
CryThreadImpl_windows.h
|
||||
CryWindows.h
|
||||
Linux32Specific.h
|
||||
Linux64Specific.h
|
||||
Linux_Win32Wrapper.h
|
||||
|
||||
@@ -47,11 +47,9 @@
|
||||
#define VK_SCROLL 0
|
||||
|
||||
|
||||
//#define USE_CRT 1
|
||||
#if !defined(PLATFORM_64BIT)
|
||||
#error "IOS build only supports the 64bit architecture"
|
||||
#else
|
||||
#define SIZEOF_PTR 8
|
||||
typedef uint64_t threadID;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -263,7 +263,6 @@ ILINE DestinationType alias_cast(SourceType pPtr)
|
||||
#define assert CRY_ASSERT
|
||||
#endif
|
||||
|
||||
#include "CompileTimeAssert.h"
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// Platform dependent functions that emulate Win32 API.
|
||||
// Mostly used only for debugging!
|
||||
|
||||
@@ -66,9 +66,9 @@ private:
|
||||
# if !defined(eLittleEndian)
|
||||
# error eLittleEndian is not defined, please include CryEndian.h.
|
||||
# endif
|
||||
COMPILE_TIME_ASSERT(metautils::is_const<dtype>::value || !metautils::is_const<dtype1>::value);
|
||||
static_assert(metautils::is_const<dtype>::value || !metautils::is_const<dtype1>::value);
|
||||
// note: we allow xint32 -> xint16 converting
|
||||
COMPILE_TIME_ASSERT(
|
||||
static_assert(
|
||||
(metautils::is_same<typename metautils::remove_const<dtype1>::type, typename metautils::remove_const<dtype>::type>::value ||
|
||||
((metautils::is_same<typename metautils::remove_const<dtype1>::type, sint32>::value ||
|
||||
metautils::is_same<typename metautils::remove_const<dtype1>::type, uint32>::value ||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <CryWindows.h>
|
||||
#include <AzCore/PlatformIncl.h>
|
||||
#include <tlhelp32.h>
|
||||
#undef GetCharWidth
|
||||
#undef GetUserName
|
||||
|
||||
@@ -33,10 +33,6 @@
|
||||
|
||||
#include <AzCore/Script/ScriptSystemBus.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <CryWindows.h>
|
||||
#endif
|
||||
|
||||
namespace LegacyLevelSystem
|
||||
{
|
||||
static constexpr const char* ArchiveExtension = ".pak";
|
||||
|
||||
@@ -194,7 +194,7 @@ void XMLBinary::XMLBinaryReader::CheckHeader(const BinaryFileHeader& header, siz
|
||||
// Check the signature of the file to make sure that it is a binary XML file.
|
||||
{
|
||||
static const char signature[] = "CryXmlB";
|
||||
COMPILE_TIME_ASSERT(sizeof(signature) == sizeof(header.szSignature));
|
||||
static_assert(sizeof(signature) == sizeof(header.szSignature));
|
||||
if (memcmp(header.szSignature, signature, sizeof(header.szSignature)) != 0)
|
||||
{
|
||||
result = eResult_NotBinXml;
|
||||
|
||||
@@ -109,7 +109,7 @@ bool XMLBinary::CXMLBinaryWriter::WriteNode(IDataWriter* pFile, XmlNodeRef node,
|
||||
|
||||
BinaryFileHeader header;
|
||||
static const char signature[] = "CryXmlB";
|
||||
COMPILE_TIME_ASSERT(sizeof(signature) == sizeof(header.szSignature));
|
||||
static_assert(sizeof(signature) == sizeof(header.szSignature));
|
||||
memcpy(header.szSignature, signature, sizeof(header.szSignature));
|
||||
nTheoreticalPosition += sizeof(header);
|
||||
align(nTheoreticalPosition, nAlignment);
|
||||
|
||||
Reference in New Issue
Block a user