mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 01:22:25 +00:00
Fix compile with -ansi on windows.
This commit is contained in:
parent
4415cf4a51
commit
16281bac17
@ -311,8 +311,6 @@ builds = {
|
|||||||
"release" : dict(CXXFLAGS = Split("-O2 -ansi")),
|
"release" : dict(CXXFLAGS = Split("-O2 -ansi")),
|
||||||
"profile" : dict(CXXFLAGS = "-pg", LINKFLAGS = "-pg")
|
"profile" : dict(CXXFLAGS = "-pg", LINKFLAGS = "-pg")
|
||||||
}
|
}
|
||||||
if sys.platform == "win32":
|
|
||||||
builds["release"] = {} # Both -O2 and -ansi cause Bad Things to happen on windows
|
|
||||||
build = env["build"]
|
build = env["build"]
|
||||||
|
|
||||||
env.AppendUnique(**builds[build])
|
env.AppendUnique(**builds[build])
|
||||||
|
@ -38,6 +38,10 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Tests one locale to be available. */
|
/** Tests one locale to be available. */
|
||||||
static bool has_locale(const char* s) {
|
static bool has_locale(const char* s) {
|
||||||
try {
|
try {
|
||||||
@ -192,8 +196,7 @@ static void wesnoth_setlocale(int category, std::string const &slocale,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
const std::string env = "LANG=" + slocale;
|
SetEnvironmentVariable("LANG", slocale.c_str());
|
||||||
putenv(env.c_str());
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_DUMMYLOCALES
|
#ifdef USE_DUMMYLOCALES
|
||||||
|
@ -1773,7 +1773,7 @@ int main(int argc, char** argv) {
|
|||||||
<< "\n";
|
<< "\n";
|
||||||
return 0;
|
return 0;
|
||||||
} else if (val == "--daemon" || val == "-d") {
|
} else if (val == "--daemon" || val == "-d") {
|
||||||
#ifdef WIN32
|
#ifdef _WIN32
|
||||||
ERR_SERVER << "Running as a daemon is not supported on this platform\n";
|
ERR_SERVER << "Running as a daemon is not supported on this platform\n";
|
||||||
return -1;
|
return -1;
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user