From 3eb399624167f5607cc372fb7454bd7183f32ad9 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 2 Nov 2014 16:19:14 +0300 Subject: [PATCH] Fix android build. --- Global.h | 2 ++ client/CMT.cpp | 8 ++++---- lib/VCMIDirs.cpp | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Global.h b/Global.h index 50c85fd15..a7f4a6146 100644 --- a/Global.h +++ b/Global.h @@ -137,7 +137,9 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size."); #include #include #include +#ifndef VCMI_ANDROID #include +#endif #include #include #include diff --git a/client/CMT.cpp b/client/CMT.cpp index f88491db0..7607bf545 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -194,6 +194,10 @@ int SDL_main(int argc, char *argv[]) int main(int argc, char** argv) #endif { +#ifdef VCMI_ANDROID + // boost will crash without this + setenv("LANG", "C", 1); +#endif #ifdef VCMI_APPLE // Correct working dir executable folder (not bundle folder) so we can use executable relative paths std::string executablePath = argv[0]; @@ -286,10 +290,6 @@ int main(int argc, char** argv) logGlobal->infoStream() << "Creating console and configuring logger: " << pomtime.getDiff(); logGlobal->infoStream() << "The log file will be saved to " << logPath; -#ifdef VCMI_ANDROID - // boost will crash without this - setenv("LANG", "C", 1); -#endif // Init filesystem and settings preinitDLL(::console); settings.init(); diff --git a/lib/VCMIDirs.cpp b/lib/VCMIDirs.cpp index caf93cb5f..be83e9a6a 100644 --- a/lib/VCMIDirs.cpp +++ b/lib/VCMIDirs.cpp @@ -573,7 +573,9 @@ namespace VCMIDirs static bool initialized = false; if (!initialized) { + #ifndef VCMI_ANDROID std::locale::global(boost::locale::generator().generate("en_US.UTF-8")); + #endif boost::filesystem::path::imbue(std::locale()); singleton.init();