diff options
author | Evan Martin <martine@danga.com> | 2013-04-09 18:02:53 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-04-09 18:02:53 (GMT) |
commit | 82450cb61eb040f47f1d30ef3dd581dbed98af69 (patch) | |
tree | 826061480953dd3891dbdeec205c674492b299d0 /src | |
parent | 0bdf68607c5f381376bc8c2b0ddb1d80eac6aaa2 (diff) | |
parent | 78effcb85dbb45633f6735e48a815bd43d5de578 (diff) | |
download | Ninja-82450cb61eb040f47f1d30ef3dd581dbed98af69.zip Ninja-82450cb61eb040f47f1d30ef3dd581dbed98af69.tar.gz Ninja-82450cb61eb040f47f1d30ef3dd581dbed98af69.tar.bz2 |
Merge pull request #535 from sgraham/fix-windows-depslog
fix windows build after depslog
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 2 | ||||
-rw-r--r-- | src/build.h | 4 | ||||
-rw-r--r-- | src/deps_log.cc | 2 | ||||
-rw-r--r-- | src/line_printer.cc | 10 | ||||
-rw-r--r-- | src/line_printer.h | 8 | ||||
-rw-r--r-- | src/ninja_test.cc | 2 |
6 files changed, 16 insertions, 12 deletions
diff --git a/src/build.cc b/src/build.cc index ab3d781..39e3e2a 100644 --- a/src/build.cc +++ b/src/build.cc @@ -247,7 +247,7 @@ void BuildStatus::PrintStatus(Edge* edge) { to_print = FormatProgressStatus(progress_status_format_) + to_print; printer_.Print(to_print, - force_full_command ? LinePrinter::FULL : LinePrinter::SHORT); + force_full_command ? LinePrinter::FULL : LinePrinter::ELIDE); } Plan::Plan() : command_edges_(0), wanted_edges_(0) {} diff --git a/src/build.h b/src/build.h index 9a16990..ca75ade 100644 --- a/src/build.h +++ b/src/build.h @@ -275,10 +275,6 @@ struct BuildStatus { mutable RateInfo overall_rate_; mutable SlidingRateInfo current_rate_; - -#ifdef _WIN32 - void* console_; -#endif }; #endif // NINJA_BUILD_H_ diff --git a/src/deps_log.cc b/src/deps_log.cc index 79daba5..ceb75ce 100644 --- a/src/deps_log.cc +++ b/src/deps_log.cc @@ -18,7 +18,9 @@ #include <stdio.h> #include <errno.h> #include <string.h> +#ifndef _WIN32 #include <unistd.h> +#endif #include "graph.h" #include "metrics.h" diff --git a/src/line_printer.cc b/src/line_printer.cc index d30dd2c..751fb07 100644 --- a/src/line_printer.cc +++ b/src/line_printer.cc @@ -57,7 +57,7 @@ void LinePrinter::Print(std::string to_print, LineType type) { #endif } - if (smart_terminal_ && type == SHORT) { + if (smart_terminal_ && type == ELIDE) { #ifdef _WIN32 // Don't use the full width or console will move to next line. size_t width = static_cast<size_t>(csbi.dwSize.X) - 1; @@ -68,9 +68,11 @@ void LinePrinter::Print(std::string to_print, LineType type) { GetConsoleScreenBufferInfo(console_, &csbi); COORD buf_size = { csbi.dwSize.X, 1 }; COORD zero_zero = { 0, 0 }; - SMALL_RECT target = { csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y, - (SHORT)(csbi.dwCursorPosition.X + csbi.dwSize.X - 1), - csbi.dwCursorPosition.Y }; + SMALL_RECT target = { + csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y, + static_cast<SHORT>(csbi.dwCursorPosition.X + csbi.dwSize.X - 1), + csbi.dwCursorPosition.Y + }; CHAR_INFO* char_data = new CHAR_INFO[csbi.dwSize.X]; memset(char_data, 0, sizeof(CHAR_INFO) * csbi.dwSize.X); for (int i = 0; i < csbi.dwSize.X; ++i) { diff --git a/src/line_printer.h b/src/line_printer.h index 78510ea..4226c92 100644 --- a/src/line_printer.h +++ b/src/line_printer.h @@ -28,9 +28,9 @@ class LinePrinter { enum LineType { FULL, - SHORT + ELIDE }; - /// Overprints the current line. If type is SHORT, elides to_print to fit on + /// Overprints the current line. If type is ELIDE, elides to_print to fit on /// one line. void Print(std::string to_print, LineType type); @@ -43,6 +43,10 @@ class LinePrinter { /// Whether the caret is at the beginning of a blank line. bool have_blank_line_; + +#ifdef _WIN32 + void* console_; +#endif }; #endif // NINJA_LINE_PRINTER_H_ diff --git a/src/ninja_test.cc b/src/ninja_test.cc index 3376050..02f2c6b 100644 --- a/src/ninja_test.cc +++ b/src/ninja_test.cc @@ -42,7 +42,7 @@ class LaconicPrinter : public testing::EmptyTestEventListener { ++tests_started_; printer_.Print(StringPrintf("[%d/%d] %s.%s", tests_started_, test_count_, test_info.test_case_name(), test_info.name()), - LinePrinter::SHORT); + LinePrinter::ELIDE); } virtual void OnTestPartResult( |