From 0876886c60901c053b13d89d21c1e9e084b00c71 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 20 Jun 2017 08:17:23 -0700 Subject: [PATCH] Fix build error on Linux for INT_MIN (#10) * Fix compiler warnings and turn on warnings as errors * Fix build error on Linux for INT_MIN --- src/project.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/project.cc b/src/project.cc index c4a5752e..31db37eb 100644 --- a/src/project.cc +++ b/src/project.cc @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -385,7 +386,7 @@ Project::Entry Project::FindCompilationEntryForFile(const std::string& filename) // We couldn't find the file. Try to infer it. // TODO: Cache inferred file in a separate array (using a lock or similar) Entry* best_entry = nullptr; - int best_score = INT_MIN; + int best_score = std::numeric_limits::min(); for (Entry& entry : entries) { int score = ComputeGuessScore(filename, entry.filename); if (score > best_score) {