From 4022bac855a790b3a42fcb44c06f62dbbe078c5a Mon Sep 17 00:00:00 2001 From: Loo Rong Jie Date: Mon, 11 Jun 2018 02:04:52 -0700 Subject: Remove usage of COMPILER_MSVC in Bazel and ijar Convert most `COMPILER_MSVC` to `_WIN32` (as they apply to Windows platform, not MSVC compiler). Only `src/tools/singlejar/zip_headers.h` and `src/main/cpp/util/md5.h` actually need `_MSC_VER`. `COMPILER_MSVC` in `third_party/protobuf` are not removed. They can be fixed by updating dependency to newer version. /cc @meteorcloudy Closes #5350. Change-Id: Ibc131abfaf34a0cb2bd338549983ea9d28eaabfe PiperOrigin-RevId: 200019793 --- src/main/cpp/option_processor.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/cpp/option_processor.cc') diff --git a/src/main/cpp/option_processor.cc b/src/main/cpp/option_processor.cc index c2f480f545..582833ab88 100644 --- a/src/main/cpp/option_processor.cc +++ b/src/main/cpp/option_processor.cc @@ -387,7 +387,7 @@ blaze_exit_code::ExitCode OptionProcessor::ParseStartupOptions( } static bool IsValidEnvName(const char* p) { -#if defined(COMPILER_MSVC) || defined(__CYGWIN__) +#if defined(_WIN32) || defined(__CYGWIN__) for (; *p && *p != '='; ++p) { if (!((*p >= 'a' && *p <= 'z') || (*p >= 'A' && *p <= 'Z') || (*p >= '0' && *p <= '9') || *p == '_')) { @@ -398,7 +398,7 @@ static bool IsValidEnvName(const char* p) { return true; } -#if defined(COMPILER_MSVC) +#if defined(_WIN32) static void PreprocessEnvString(string* env_str) { static constexpr const char* vars_to_uppercase[] = {"PATH", "SYSTEMROOT", "TEMP", "TEMPDIR", "TMP"}; @@ -415,7 +415,7 @@ static void PreprocessEnvString(string* env_str) { } } -#elif defined(__CYGWIN__) // not defined(COMPILER_MSVC) +#elif defined(__CYGWIN__) // not defined(_WIN32) static void PreprocessEnvString(string* env_str) { int pos = env_str->find_first_of('='); @@ -435,7 +435,7 @@ static void PreprocessEnvString(string* env_str) { static void PreprocessEnvString(const string* env_str) { // do nothing. } -#endif // defined(COMPILER_MSVC) +#endif // defined(_WIN32) static std::vector GetProcessedEnv() { std::vector processed_env; -- cgit v1.2.3