Hiding squirrel compiler warnings when building vscript (fixes #14)

This commit is contained in:
James Mitchell 2020-06-07 14:47:49 +10:00
parent 14efc92e33
commit 859447ee69
2 changed files with 33 additions and 25 deletions

View File

@ -13,9 +13,6 @@ $Configuration
$Compiler $Compiler
{ {
$AdditionalIncludeDirectories "$BASE;.\squirrel\include" $AdditionalIncludeDirectories "$BASE;.\squirrel\include"
// Squirrel third party library is full of warnings, so we disable warnings as errors
$TreatWarningsAsErrors "No"
} }
} }
@ -29,26 +26,37 @@ $Project "VScript"
$Folder "squirrel" $Folder "squirrel"
{ {
$File ".\squirrel\sqstdlib\sqstdaux.cpp" $File ".\squirrel\sqstdlib\sqstdaux.cpp" \
$File ".\squirrel\sqstdlib\sqstdblob.cpp" ".\squirrel\sqstdlib\sqstdblob.cpp" \
$File ".\squirrel\sqstdlib\sqstdio.cpp" ".\squirrel\sqstdlib\sqstdio.cpp" \
$File ".\squirrel\sqstdlib\sqstdmath.cpp" ".\squirrel\sqstdlib\sqstdmath.cpp" \
$File ".\squirrel\sqstdlib\sqstdrex.cpp" ".\squirrel\sqstdlib\sqstdrex.cpp" \
$File ".\squirrel\sqstdlib\sqstdstream.cpp" ".\squirrel\sqstdlib\sqstdstream.cpp" \
$File ".\squirrel\sqstdlib\sqstdstring.cpp" ".\squirrel\sqstdlib\sqstdstring.cpp" \
$File ".\squirrel\sqstdlib\sqstdsystem.cpp" ".\squirrel\sqstdlib\sqstdsystem.cpp" \
$File ".\squirrel\squirrel\sqapi.cpp" ".\squirrel\squirrel\sqapi.cpp" \
$File ".\squirrel\squirrel\sqbaselib.cpp" ".\squirrel\squirrel\sqbaselib.cpp" \
$File ".\squirrel\squirrel\sqclass.cpp" ".\squirrel\squirrel\sqclass.cpp" \
$File ".\squirrel\squirrel\sqcompiler.cpp" ".\squirrel\squirrel\sqcompiler.cpp" \
$File ".\squirrel\squirrel\sqdebug.cpp" ".\squirrel\squirrel\sqdebug.cpp" \
$File ".\squirrel\squirrel\sqfuncstate.cpp" ".\squirrel\squirrel\sqfuncstate.cpp" \
$File ".\squirrel\squirrel\sqlexer.cpp" ".\squirrel\squirrel\sqlexer.cpp" \
$File ".\squirrel\squirrel\sqmem.cpp" ".\squirrel\squirrel\sqmem.cpp" \
$File ".\squirrel\squirrel\sqobject.cpp" ".\squirrel\squirrel\sqobject.cpp" \
$File ".\squirrel\squirrel\sqstate.cpp" ".\squirrel\squirrel\sqstate.cpp" \
$File ".\squirrel\squirrel\sqtable.cpp" ".\squirrel\squirrel\sqtable.cpp" \
$File ".\squirrel\squirrel\sqvm.cpp" ".\squirrel\squirrel\sqvm.cpp"
{
$Configuration
{
$Compiler
{
// Squirrel third party library is full of warnings
$AdditionalOptions "$BASE /wd4100 /wd4611 /wd4127 /wd4244 /wd4702 /wd4706 /wd4800"
$TreatWarningsAsErrors "No"
}
}
}
} }
} }
} }

View File

@ -802,7 +802,7 @@ bool getVariant(HSQUIRRELVM vm, SQInteger idx, ScriptVariant_t& variant)
{ {
return false; return false;
} }
variant = (bool)val; variant = val ? true : false;
return true; return true;
} }
case OT_STRING: case OT_STRING:
@ -911,7 +911,7 @@ SQInteger function_stub(HSQUIRRELVM vm)
SQBool val = 0; SQBool val = 0;
if (SQ_FAILED(sq_getbool(vm, i + 2, &val))) if (SQ_FAILED(sq_getbool(vm, i + 2, &val)))
return sq_throwerror(vm, "Expected bool"); return sq_throwerror(vm, "Expected bool");
params[i] = (bool)val; params[i] = val ? true : false;
break; break;
} }
case FIELD_CHARACTER: case FIELD_CHARACTER: