Author: cycholka
Date: Sun Jun 22 12:42:37 2008
New Revision: 27394

URL: http://svn.gna.org/viewcvs/wesnoth?rev=27394&view=rev
Log:
Revert replacing putenv() with SetEnviromentVariable() since the latter fails 
to work properly. Use ISO C++ conformant _putenv() instead.
Comment out some WIN32 only code introduced earlier that doesn't do anything on 
its own yet.

Modified:
    trunk/src/language.cpp

Modified: trunk/src/language.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/language.cpp?rev=27394&r1=27393&r2=27394&view=diff
==============================================================================
--- trunk/src/language.cpp (original)
+++ trunk/src/language.cpp Sun Jun 22 12:42:37 2008
@@ -38,7 +38,7 @@
 #include <stdexcept>
 
 #ifdef _WIN32
-#include "locale.h"
+//#include "locale.h"
 #include <windows.h>
 #endif
 
@@ -198,7 +198,8 @@
 #endif
 
 #ifdef _WIN32
-       SetEnvironmentVariable("LANG", slocale.c_str());
+       const std::string env = "LANG=" + slocale;
+       _putenv(env.c_str());
 #endif
 
 #ifdef USE_DUMMYLOCALES
@@ -229,27 +230,27 @@
        std::vector<std::string>::const_iterator i;
        if (alternates) i = alternates->begin();
        while (true) {
-        #ifndef _WIN32  
+//        #ifndef _WIN32  
                res = std::setlocale(category, try_loc);
-               #else
-               res = ::setlocale(category, try_loc);
-               #endif
+//             #else
+//             res = ::setlocale(category, try_loc);
+//             #endif
                if (res) break;
 
                std::string utf8 = std::string(try_loc) + std::string(".utf-8");
-               #ifndef _WIN32
+//             #ifndef _WIN32
                res = std::setlocale(category, utf8.c_str());
-               #else
-               res = ::setlocale(category, try_loc);
-               #endif
+//             #else
+//             res = ::setlocale(category, try_loc);
+//             #endif
                if (res) break;
 
                utf8 = std::string(try_loc) + std::string(".UTF-8");
-               #ifndef _WIN32
+//             #ifndef _WIN32
                res = std::setlocale(category, utf8.c_str());
-               #else
-               res = ::setlocale(category, utf8.c_str());
-               #endif
+///            #else
+//             res = ::setlocale(category, utf8.c_str());
+//             #endif
                if (res) break;
 
                if (!alternates) break;


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to