From 564f02c91ec0e983806762de4b842a762e21bb47 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Fri, 11 Aug 2017 12:08:00 -0700 Subject: Make win32_io only for MSVC This excludes cygwin and mingw from using the self implemented functions. --- src/google/protobuf/io/zero_copy_stream_impl.cc | 3 +++ src/google/protobuf/io/zero_copy_stream_unittest.cc | 3 +++ 2 files changed, 6 insertions(+) (limited to 'src/google/protobuf/io') diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc index f72add41..81fb5033 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl.cc @@ -56,6 +56,9 @@ namespace io { // Win32 lseek is broken: If invoked on a non-seekable file descriptor, its // return value is undefined. We re-define it to always produce an error. #define lseek(fd, offset, origin) ((off_t)-1) +#endif + +#ifdef _MSC_VER // DO NOT include , instead create functions in io_win32.{h,cc} and import // them like we do below. using google::protobuf::internal::win32::access; diff --git a/src/google/protobuf/io/zero_copy_stream_unittest.cc b/src/google/protobuf/io/zero_copy_stream_unittest.cc index f3754087..2bca6a90 100644 --- a/src/google/protobuf/io/zero_copy_stream_unittest.cc +++ b/src/google/protobuf/io/zero_copy_stream_unittest.cc @@ -83,6 +83,9 @@ namespace { #ifdef _WIN32 #define pipe(fds) _pipe(fds, 4096, O_BINARY) +#endif + +#ifdef _MSC_VER // DO NOT include , instead create functions in io_win32.{h,cc} and import // them like we do below. using google::protobuf::internal::win32::access; -- cgit v1.2.3