1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00

Replace COMPILER_ASSERT with C++0B static_assert

This commit is contained in:
2012-06-17 03:10:59 -04:00
parent 5d30f69957
commit 3667fb62e2
18 changed files with 23 additions and 33 deletions

View File

@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
***/
// make sure our definition is at least as big as the compiler's definition
COMPILER_ASSERT(MAX_PATH >= _MAX_PATH);
static_assert(MAX_PATH >= _MAX_PATH, "Windows and STDlib MAX_PATH constants differ");
//===========================================================================
@ -546,7 +546,7 @@ EPathCreateDirError PathCreateDirectory (const wchar_t path[], unsigned flags) {
// if we successfully created the directory then we're done
if (result) {
// Avoid check for kPathCreateDirFlagOsError
COMPILER_ASSERT(kPathCreateDirSuccess == NO_ERROR);
static_assert(kPathCreateDirSuccess == NO_ERROR, "Path creation success and NO_ERROR constants differ");
return kPathCreateDirSuccess;
}

View File

@ -51,8 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if 0
COMPILER_ASSERT(sizeof(Uuid) >= sizeof(GUID));
void Uuid::Clear()
{
UuidCreateNil( (GUID *)this );
@ -120,7 +118,7 @@ Uuid Uuid::Generate()
*
***/
COMPILER_ASSERT(sizeof(Uuid) >= sizeof(GUID));
static_assert(sizeof(Uuid) >= sizeof(GUID), "pnUtils Uuid and Win32 GUID types differ in size");
//============================================================================
Uuid GuidGenerate () {
@ -137,7 +135,7 @@ void GuidClear (Uuid * uuid) {
//============================================================================
bool GuidFromString (const wchar_t str[], Uuid * uuid) {
ASSERT(uuid);
COMPILER_ASSERT(sizeof(wchar_t) == sizeof(unsigned short));
static_assert(sizeof(wchar_t) == sizeof(unsigned short), "Wchar is not an uint16");
return RPC_S_OK == UuidFromStringW((unsigned short *) str, (GUID *) uuid);
}