aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-11-10 10:28:14 -0800
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-11-10 10:28:14 -0800
commit9c197b7ecba6019b7c81c673cf100b2fad4033ad (patch)
treeaa997af1d17ed7549e654d56671cf0fa1c87e2d9 /src/google/protobuf/stubs
parent5eb717c3006ad7da9aa6e49d40328a3963ad22a3 (diff)
Support win32 long path for cross compiled build
Diffstat (limited to 'src/google/protobuf/stubs')
-rw-r--r--src/google/protobuf/stubs/io_win32.cc4
-rw-r--r--src/google/protobuf/stubs/io_win32.h6
-rw-r--r--src/google/protobuf/stubs/io_win32_unittest.cc4
3 files changed, 4 insertions, 10 deletions
diff --git a/src/google/protobuf/stubs/io_win32.cc b/src/google/protobuf/stubs/io_win32.cc
index 7e1cf785..fa2cb8b1 100644
--- a/src/google/protobuf/stubs/io_win32.cc
+++ b/src/google/protobuf/stubs/io_win32.cc
@@ -39,7 +39,7 @@
//
// This file is only used on Windows, it's empty on other platforms.
-#if defined(_MSC_VER)
+#if defined(_WIN32)
// Comment this out to fall back to using the ANSI versions (open, mkdir, ...)
// instead of the Unicode ones (_wopen, _wmkdir, ...). Doing so can be useful to
@@ -358,5 +358,5 @@ wstring testonly_path_to_winpath(const string& path) {
} // namespace protobuf
} // namespace google
-#endif // defined(_MSC_VER)
+#endif // defined(_WIN32)
diff --git a/src/google/protobuf/stubs/io_win32.h b/src/google/protobuf/stubs/io_win32.h
index a20e64c7..53160089 100644
--- a/src/google/protobuf/stubs/io_win32.h
+++ b/src/google/protobuf/stubs/io_win32.h
@@ -52,7 +52,6 @@
// Compilers on Windows other than MSVC (e.g. Cygwin, MinGW32) define the
// following functions already, except for mkdir.
-#ifdef _MSC_VER
namespace google {
namespace protobuf {
namespace internal {
@@ -77,9 +76,6 @@ LIBPROTOBUF_EXPORT std::wstring testonly_path_to_winpath(
} // namespace internal
} // namespace protobuf
} // namespace google
-#else // _MSC_VER
-#define mkdir(name, mode) mkdir(name)
-#endif // !_MSC_VER
#ifndef W_OK
#define W_OK 02 // not defined by MSVC for whatever reason
@@ -100,5 +96,3 @@ LIBPROTOBUF_EXPORT std::wstring testonly_path_to_winpath(
#endif // defined(_WIN32)
#endif // GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
-
-
diff --git a/src/google/protobuf/stubs/io_win32_unittest.cc b/src/google/protobuf/stubs/io_win32_unittest.cc
index 288f27ab..ce6f7162 100644
--- a/src/google/protobuf/stubs/io_win32_unittest.cc
+++ b/src/google/protobuf/stubs/io_win32_unittest.cc
@@ -34,7 +34,7 @@
//
// This file is only used on Windows, it's empty on other platforms.
-#if defined(_MSC_VER)
+#if defined(_WIN32)
#define WIN32_LEAN_AND_MEAN
#include <errno.h>
@@ -369,5 +369,5 @@ TEST_F(IoWin32Test, AsWindowsPathTest) {
} // namespace protobuf
} // namespace google
-#endif // defined(_MSC_VER)
+#endif // defined(_WIN32)