Bläddra i källkod

Fix android build.

Ilya Zhuravlev 11 år sedan
förälder
incheckning
3eb3996241
3 ändrade filer med 8 tillägg och 4 borttagningar
  1. 2 0
      Global.h
  2. 4 4
      client/CMT.cpp
  3. 2 0
      lib/VCMIDirs.cpp

+ 2 - 0
Global.h

@@ -137,7 +137,9 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
 #include <boost/format.hpp>
 #include <boost/functional/hash.hpp>
 #include <boost/lexical_cast.hpp>
+#ifndef VCMI_ANDROID
 #include <boost/locale/generator.hpp>
+#endif
 #include <boost/logic/tribool.hpp>
 #include <boost/optional.hpp>
 #include <boost/program_options.hpp>

+ 4 - 4
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();

+ 2 - 0
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();