Solve the error when compile project with NDK r10.

This commit is contained in:
zhangbin
2016-08-30 14:08:27 +08:00
parent ee71fcafeb
commit 6c92d8daaa
+6 -1
View File
@@ -412,7 +412,12 @@ void TMXMapInfo::startElement(void *ctx, const char *name, const char **atts)
if (startPos != string::npos) {
colorStr.replace(startPos, 1, "");
}
int num = stoi(colorStr.c_str(), 0, 16);
// Android NDK 10 doesn't support std::stoi a/ std::stoul
#if CC_TARGET_PLATFORM != CC_PLATFORM_ANDROID
int num = std::stoi(colorStr);
#else
int num = atoi(colorStr.c_str());
#endif
int r = num / 0x10000;
int g = (num / 0x100) % 0x100;
int b = num % 0x100;