Merge pull request #781 from daniel347x/patch-1
Change constants used in 'ToBool' to support MSVC
This commit is contained in:
12
tinyxml2.cpp
12
tinyxml2.cpp
@@ -617,17 +617,17 @@ bool XMLUtil::ToBool( const char* str, bool* value )
|
|||||||
*value = (ival==0) ? false : true;
|
*value = (ival==0) ? false : true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static const char* TRUE[] = { "true", "True", "TRUE", 0 };
|
static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 };
|
||||||
static const char* FALSE[] = { "false", "False", "FALSE", 0 };
|
static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 };
|
||||||
|
|
||||||
for (int i = 0; TRUE[i]; ++i) {
|
for (int i = 0; TRUE_VALS[i]; ++i) {
|
||||||
if (StringEqual(str, TRUE[i])) {
|
if (StringEqual(str, TRUE_VALS[i])) {
|
||||||
*value = true;
|
*value = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i = 0; FALSE[i]; ++i) {
|
for (int i = 0; FALSE_VALS[i]; ++i) {
|
||||||
if (StringEqual(str, FALSE[i])) {
|
if (StringEqual(str, FALSE_VALS[i])) {
|
||||||
*value = false;
|
*value = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user