aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/message_unittest.cc
diff options
context:
space:
mode:
authorGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-25 11:52:33 -0700
committerGravatar Jisi Liu <jisi.liu@gmail.com>2017-07-25 11:52:33 -0700
commit759245a49a00315a41b28da8fe52a2894d4f57ea (patch)
tree5a0032a1a3619a448d5301da131907ca8449730f /src/google/protobuf/message_unittest.cc
parent4bff88e0fb2338657a781eeee0c5362a57b57bf3 (diff)
Merge from master
Diffstat (limited to 'src/google/protobuf/message_unittest.cc')
-rw-r--r--src/google/protobuf/message_unittest.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/google/protobuf/message_unittest.cc b/src/google/protobuf/message_unittest.cc
index 98d9d1fc..362000c7 100644
--- a/src/google/protobuf/message_unittest.cc
+++ b/src/google/protobuf/message_unittest.cc
@@ -37,9 +37,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#ifdef _MSC_VER
-#include <io.h>
-#else
+#ifndef _MSC_VER
#include <unistd.h>
#endif
#include <sstream>
@@ -57,6 +55,7 @@
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/stubs/common.h>
+#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/logging.h>
#include <google/protobuf/testing/googletest.h>
#include <gtest/gtest.h>
@@ -64,6 +63,13 @@
namespace google {
namespace protobuf {
+#if defined(_WIN32)
+// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
+// them like we do below.
+using google::protobuf::internal::win32::close;
+using google::protobuf::internal::win32::open;
+#endif
+
#ifndef O_BINARY
#ifdef _O_BINARY
#define O_BINARY _O_BINARY