Skip to content

Commit

Permalink
fix windows build after depslog
Browse files Browse the repository at this point in the history
  • Loading branch information
sgraham committed Apr 9, 2013
1 parent 3e5dce7 commit 808aa15
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
3 changes: 1 addition & 2 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ def run(*args, **kwargs):

if options.windows:
print('Building ninja using itself...')
run([sys.executable, 'configure.py', '--with-ninja=%s' % binary] +
conf_args)
run([sys.executable, 'configure.py'] + conf_args)
run(['./' + binary] + verbose)

# Copy the new executable over the bootstrap one.
Expand Down
2 changes: 1 addition & 1 deletion src/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
2 changes: 2 additions & 0 deletions src/deps_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 6 additions & 4 deletions src/line_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions src/line_printer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -43,6 +43,8 @@ class LinePrinter {

/// Whether the caret is at the beginning of a blank line.
bool have_blank_line_;

void* console_;
};

#endif // NINJA_LINE_PRINTER_H_

0 comments on commit 808aa15

Please sign in to comment.