summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/graph.cc2
-rw-r--r--src/graph_test.cc2
-rw-r--r--src/manifest_parser.cc4
-rw-r--r--src/util.cc2
5 files changed, 10 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f609c04..2390732 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -63,6 +63,11 @@ else()
target_sources(libninja PRIVATE src/subprocess-posix.cc)
endif()
+#Fixes GetActiveProcessorCount on MinGW
+if(MINGW)
+target_compile_definitions(libninja PRIVATE _WIN32_WINNT=0x0601)
+endif()
+
# Main executable is library plus main() function.
add_executable(ninja src/ninja.cc)
target_link_libraries(ninja PRIVATE libninja libninja-re2c)
diff --git a/src/graph.cc b/src/graph.cc
index facb76d..3214513 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -383,7 +383,7 @@ std::string EdgeEnv::MakePathList(const Node* const* const span,
result.push_back(sep);
const string& path = (*i)->PathDecanonicalized();
if (escape_in_out_ == kShellEscape) {
-#if _WIN32
+#ifdef _WIN32
GetWin32EscapedString(path, &result);
#else
GetShellEscapedString(path, &result);
diff --git a/src/graph_test.cc b/src/graph_test.cc
index c8cca1c..660943f 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -218,7 +218,7 @@ TEST_F(GraphTest, VarInOutPathEscaping) {
"build a$ b: cat no'space with$ space$$ no\"space2\n"));
Edge* edge = GetNode("a b")->in_edge();
-#if _WIN32
+#ifdef _WIN32
EXPECT_EQ("cat no'space \"with space$\" \"no\\\"space2\" > \"a b\"",
edge->EvaluateCommand());
#else
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc
index 2011368..e28be2f 100644
--- a/src/manifest_parser.cc
+++ b/src/manifest_parser.cc
@@ -228,7 +228,7 @@ bool ManifestParser::ParseEdge(string* err) {
for (;;) {
EvalString out;
if (!lexer_.ReadPath(&out, err))
- return err;
+ return false;
if (out.empty())
break;
outs.push_back(out);
@@ -266,7 +266,7 @@ bool ManifestParser::ParseEdge(string* err) {
for (;;) {
EvalString in;
if (!lexer_.ReadPath(&in, err))
- return err;
+ return false;
if (in.empty())
break;
ins.push_back(in);
diff --git a/src/util.cc b/src/util.cc
index 70096cd..4df2bb2 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -576,7 +576,7 @@ double GetLoadAverage() {
// Calculation taken from comment in libperfstats.h
return double(cpu_stats.loadavg[0]) / double(1 << SBITS);
}
-#elif defined(__UCLIBC__)
+#elif defined(__UCLIBC__) || (defined(__BIONIC__) && __ANDROID_API__ < 29)
double GetLoadAverage() {
struct sysinfo si;
if (sysinfo(&si) != 0)