aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools
diff options
context:
space:
mode:
authorGravatar Loo Rong Jie <loorongjie@gmail.com>2018-06-11 02:04:52 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-11 02:06:38 -0700
commit4022bac855a790b3a42fcb44c06f62dbbe078c5a (patch)
treec4f4a7b5fb602020c724b23e3ffcca3804e1207f /src/tools
parent2c89206a407d8cae0945abe7eb179ee6bb77d9de (diff)
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
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/singlejar/diag.h2
-rw-r--r--src/tools/singlejar/mapped_file.h12
-rw-r--r--src/tools/singlejar/mapped_file_windows.inc2
-rw-r--r--src/tools/singlejar/zip_headers.h6
4 files changed, 11 insertions, 11 deletions
diff --git a/src/tools/singlejar/diag.h b/src/tools/singlejar/diag.h
index cae255f15f..6ca452afb9 100644
--- a/src/tools/singlejar/diag.h
+++ b/src/tools/singlejar/diag.h
@@ -27,7 +27,7 @@
#define diag_warn(...) warn(__VA_ARGS__)
#define diag_warnx(...) warnx(__VA_ARGS__)
-#elif defined(COMPILER_MSVC)
+#elif defined(_WIN32)
#include <stdio.h>
#include <string.h>
diff --git a/src/tools/singlejar/mapped_file.h b/src/tools/singlejar/mapped_file.h
index 610ad46969..f4ada45a2b 100644
--- a/src/tools/singlejar/mapped_file.h
+++ b/src/tools/singlejar/mapped_file.h
@@ -28,11 +28,11 @@
*/
class MappedFile {
public:
-#ifdef COMPILER_MSVC
+#ifdef _WIN32
typedef /* HANDLE = void* */ void *FileHandleType;
-#else // not COMPILER_MSVC
+#else // not _WIN32
typedef int FileHandleType;
-#endif // COMPILER_MSVC
+#endif // _WIN32
MappedFile();
@@ -64,10 +64,10 @@ class MappedFile {
FileHandleType fd_;
};
-#ifdef COMPILER_MSVC
+#ifdef _WIN32
#include "src/tools/singlejar/mapped_file_windows.inc"
-#else // not COMPILER_MSVC
+#else // not _WIN32
#include "src/tools/singlejar/mapped_file_posix.inc"
-#endif // COMPILER_MSVC
+#endif // _WIN32
#endif // BAZEL_SRC_TOOLS_SINGLEJAR_MAPPED_FILE_H_
diff --git a/src/tools/singlejar/mapped_file_windows.inc b/src/tools/singlejar/mapped_file_windows.inc
index 5875149766..366103f57a 100644
--- a/src/tools/singlejar/mapped_file_windows.inc
+++ b/src/tools/singlejar/mapped_file_windows.inc
@@ -15,7 +15,7 @@
#ifndef BAZEL_SRC_TOOLS_SINGLEJAR_MAPPED_FILE_WINDOWS_H_
#define BAZEL_SRC_TOOLS_SINGLEJAR_MAPPED_FILE_WINDOWS_H_ 1
-#if !defined(COMPILER_MSVC) || !defined(_WIN64)
+#if !defined(_WIN64)
#error This code is for 64 bit Windows.
#endif
diff --git a/src/tools/singlejar/zip_headers.h b/src/tools/singlejar/zip_headers.h
index 6d10cc26e5..3677a20710 100644
--- a/src/tools/singlejar/zip_headers.h
+++ b/src/tools/singlejar/zip_headers.h
@@ -29,7 +29,7 @@
#include <endian.h>
#elif defined(__FreeBSD__)
#include <sys/endian.h>
-#elif defined(__APPLE__) || defined(COMPILER_MSVC)
+#elif defined(__APPLE__) || defined(_WIN32)
// Hopefully OSX and Windows will keep running solely on little endian CPUs, so:
#define le16toh(x) (x)
#define le32toh(x) (x)
@@ -44,7 +44,7 @@
#include <string>
#include <type_traits>
-#ifdef COMPILER_MSVC
+#ifdef _MSC_VER
#pragma pack(push, 1)
#define attr_packed
#else
@@ -653,7 +653,7 @@ class ECD64 {
} attr_packed;
static_assert(56 == sizeof(ECD64), "ECD64 class fields layout is incorrect.");
-#ifdef COMPILER_MSVC
+#ifdef _MSC_VER
#pragma pack(pop)
#endif