From 52fee828f024e2ffba47895aa7901a2188b2c13a Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 29 Jan 2015 10:09:28 -0800 Subject: [PATCH] Fix IntToWide, ColorToWide on Android --- legacy/project/src/common/Utils.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/legacy/project/src/common/Utils.cpp b/legacy/project/src/common/Utils.cpp index 7247e5bc4..e6f0449f1 100644 --- a/legacy/project/src/common/Utils.cpp +++ b/legacy/project/src/common/Utils.cpp @@ -27,6 +27,7 @@ #ifdef ANDROID #include +#include #endif #ifdef TIZEN @@ -200,6 +201,11 @@ std::string WideToUTF8(const WString &inWideString) WString IntToWide(int value) { + #ifdef ANDROID + std::wstringstream wss; + wss << value; + return WString(wss.str().c_str()); + #else wchar_t buffer[16]; #ifdef __MINGW32__ swprintf(buffer, L"%i", value); @@ -207,10 +213,16 @@ WString IntToWide(int value) swprintf(buffer, 16, L"%i", value); #endif return WString(buffer); + #endif } WString ColorToWide(int value) { + #ifdef ANDROID + std::wstringstream wss; + wss << value; + return WString(wss.str().c_str()); + #else wchar_t buffer[40]; #ifdef __MINGW32__ swprintf(buffer, L"%X", value); @@ -218,6 +230,7 @@ WString ColorToWide(int value) swprintf(buffer, 40, L"%X", value); #endif return WString(buffer); + #endif }