From 6c92d8daaaa7305e328f90d00d64de3a5d11ebb4 Mon Sep 17 00:00:00 2001 From: zhangbin Date: Tue, 30 Aug 2016 14:08:27 +0800 Subject: [PATCH] Solve the error when compile project with NDK r10. --- native/cocos/2d/CCTMXXMLParser.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/native/cocos/2d/CCTMXXMLParser.cpp b/native/cocos/2d/CCTMXXMLParser.cpp index d875a6c8ad..ba4743eee3 100644 --- a/native/cocos/2d/CCTMXXMLParser.cpp +++ b/native/cocos/2d/CCTMXXMLParser.cpp @@ -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;