diff options
author | Evan Martin <martine@danga.com> | 2012-01-22 18:22:45 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2012-01-22 18:22:45 (GMT) |
commit | faac236d26b206cd6a8f4aa6e2bca8a83f0f83fa (patch) | |
tree | bb1354e6bfb55e7540011806f3b511e79a10da63 /src | |
parent | 2ef3a546476987d6565141337c6309e7ae60f9fd (diff) | |
download | Ninja-faac236d26b206cd6a8f4aa6e2bca8a83f0f83fa.zip Ninja-faac236d26b206cd6a8f4aa6e2bca8a83f0f83fa.tar.gz Ninja-faac236d26b206cd6a8f4aa6e2bca8a83f0f83fa.tar.bz2 |
windows: use _WIN32 define everywhere
Rather than mixing use of WIN32 and _WIN32.
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 4 | ||||
-rw-r--r-- | src/build_log_test.cc | 4 | ||||
-rw-r--r-- | src/build_test.cc | 4 | ||||
-rw-r--r-- | src/disk_interface.cc | 8 | ||||
-rw-r--r-- | src/metrics.cc | 4 | ||||
-rw-r--r-- | src/ninja.cc | 10 | ||||
-rw-r--r-- | src/test.cc | 2 | ||||
-rw-r--r-- | src/util.cc | 4 | ||||
-rw-r--r-- | src/util.h | 2 |
9 files changed, 21 insertions, 21 deletions
diff --git a/src/build.cc b/src/build.cc index 8d0abce..cc877e5 100644 --- a/src/build.cc +++ b/src/build.cc @@ -65,7 +65,7 @@ BuildStatus::BuildStatus(const BuildConfig& config) start_time_millis_(GetTimeMillis()), last_update_millis_(start_time_millis_), started_edges_(0), finished_edges_(0), total_edges_(0) { -#ifndef WIN32 +#ifndef _WIN32 const char* term = getenv("TERM"); smart_terminal_ = isatty(1) && term && string(term) != "dumb"; #else @@ -171,7 +171,7 @@ void BuildStatus::PrintStatus(Edge* edge) { int progress_chars = printf("[%d/%d] ", started_edges_, total_edges_); -#ifndef WIN32 +#ifndef _WIN32 if (smart_terminal_ && !force_full_command) { // Limit output to width of the terminal if provided so we don't cause // line-wrapping. diff --git a/src/build_log_test.cc b/src/build_log_test.cc index 005b929..c6d6bc3 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -16,7 +16,7 @@ #include "test.h" -#ifdef WIN32 +#ifdef _WIN32 #include <fcntl.h> #include <share.h> #endif @@ -102,7 +102,7 @@ TEST_F(BuildLogTest, Truncate) { // For all possible truncations of the input file, assert that we don't // crash or report an error when parsing. for (off_t size = statbuf.st_size; size > 0; --size) { -#ifndef WIN32 +#ifndef _WIN32 ASSERT_EQ(0, truncate(kTestFilename, size)); #else int fh; diff --git a/src/build_test.cc b/src/build_test.cc index 497faa4..0fa23ed 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -418,7 +418,7 @@ TEST_F(BuildTest, MissingTarget) { TEST_F(BuildTest, MakeDirs) { string err; -#ifdef WIN32 +#ifdef _WIN32 ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "build subdir\\dir2\\file: cat in1\n")); EXPECT_TRUE(builder_.AddTarget("subdir\\dir2\\file", &err)); #else @@ -432,7 +432,7 @@ TEST_F(BuildTest, MakeDirs) { ASSERT_EQ("", err); ASSERT_EQ(2u, fs_.directories_made_.size()); EXPECT_EQ("subdir", fs_.directories_made_[0]); -#ifdef WIN32 +#ifdef _WIN32 EXPECT_EQ("subdir\\dir2", fs_.directories_made_[1]); #else EXPECT_EQ("subdir/dir2", fs_.directories_made_[1]); diff --git a/src/disk_interface.cc b/src/disk_interface.cc index 8cc7c2c..4e10f4e 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -19,7 +19,7 @@ #include <string.h> #include <sys/stat.h> -#ifdef WIN32 +#ifdef _WIN32 #include <windows.h> #endif @@ -28,7 +28,7 @@ namespace { string DirName(const string& path) { -#ifdef WIN32 +#ifdef _WIN32 const char kPathSeparator = '\\'; #else const char kPathSeparator = '/'; @@ -66,8 +66,8 @@ bool DiskInterface::MakeDirs(const string& path) { // RealDiskInterface ----------------------------------------------------------- TimeStamp RealDiskInterface::Stat(const string& path) { -#ifdef WIN32 - WIN32_FILE_ATTRIBUTE_DATA attrs; +#ifdef _WIN32 + _WIN32_FILE_ATTRIBUTE_DATA attrs; if (!GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &attrs)) { DWORD err = GetLastError(); if (err == ERROR_FILE_NOT_FOUND || err == ERROR_PATH_NOT_FOUND) diff --git a/src/metrics.cc b/src/metrics.cc index 1c7b7de..b2433aa 100644 --- a/src/metrics.cc +++ b/src/metrics.cc @@ -18,7 +18,7 @@ #include <stdio.h> #include <string.h> -#ifndef WIN32 +#ifndef _WIN32 #include <sys/time.h> #else #include <windows.h> @@ -30,7 +30,7 @@ Metrics* g_metrics = NULL; namespace { -#ifndef WIN32 +#ifndef _WIN32 /// Compute a platform-specific high-res timer value that fits into an int64. int64_t HighResTimer() { timeval tv; diff --git a/src/ninja.cc b/src/ninja.cc index b07c759..a599c6e 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -24,7 +24,7 @@ #include <sys/sysinfo.h> #endif -#ifdef WIN32 +#ifdef _WIN32 #include "getopt.h" #include <direct.h> #include <windows.h> @@ -107,7 +107,7 @@ int GuessParallelism() { NULL, 0) < 0) { processors = 1; } -#elif defined(WIN32) +#elif defined(_WIN32) SYSTEM_INFO info; GetSystemInfo(&info); processors = info.dwNumberOfProcessors; @@ -255,7 +255,7 @@ int ToolQuery(Globals* globals, int argc, char* argv[]) { return 0; } -#if !defined(WIN32) && !defined(NINJA_BOOTSTRAP) +#if !defined(_WIN32) && !defined(NINJA_BOOTSTRAP) int ToolBrowse(Globals* globals, int argc, char* argv[]) { if (argc < 1) { Error("expected a target to browse"); @@ -265,7 +265,7 @@ int ToolBrowse(Globals* globals, int argc, char* argv[]) { // If we get here, the browse failed. return 1; } -#endif // WIN32 +#endif // _WIN32 int ToolTargetsList(const vector<Node*>& nodes, int depth, int indent) { for (vector<Node*>::const_iterator n = nodes.begin(); @@ -475,7 +475,7 @@ int RunTool(const string& tool, Globals* globals, int argc, char** argv) { const char* desc; ToolFunc func; } tools[] = { -#if !defined(WIN32) && !defined(NINJA_BOOTSTRAP) +#if !defined(_WIN32) && !defined(NINJA_BOOTSTRAP) { "browse", "browse dependency graph in a web browser", ToolBrowse }, #endif diff --git a/src/test.cc b/src/test.cc index 47b7b23..53bd798 100644 --- a/src/test.cc +++ b/src/test.cc @@ -54,7 +54,7 @@ char* mkdtemp(char* name_template) { return name_template; } -#endif // WIN32 +#endif // _WIN32 string GetSystemTempDir() { #ifdef _WIN32 diff --git a/src/util.cc b/src/util.cc index 5f5d8dc..9f538b9 100644 --- a/src/util.cc +++ b/src/util.cc @@ -47,7 +47,7 @@ void Fatal(const char* msg, ...) { vfprintf(stderr, msg, ap); va_end(ap); fprintf(stderr, "\n"); -#ifdef WIN32 +#ifdef _WIN32 // On Windows, some tools may inject extra threads. // exit() may block on locks held by those threads, so forcibly exit. fflush(stderr); @@ -235,7 +235,7 @@ const char* SpellcheckString(const string& text, ...) { return SpellcheckStringV(text, words); } -#ifdef WIN32 +#ifdef _WIN32 string GetLastErrorString() { DWORD err = GetLastError(); @@ -16,7 +16,7 @@ #define NINJA_UTIL_H_ #pragma once -#ifdef WIN32 +#ifdef _WIN32 #include "win32port.h" #else #include <stdint.h> |