Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
564f02c9
Commit
564f02c9
authored
Aug 11, 2017
by
Jisi Liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make win32_io only for MSVC
This excludes cygwin and mingw from using the self implemented functions.
parent
7afa796b
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
22 additions
and
12 deletions
+22
-12
command_line_interface.cc
src/google/protobuf/compiler/command_line_interface.cc
+1
-1
command_line_interface_unittest.cc
...ogle/protobuf/compiler/command_line_interface_unittest.cc
+1
-1
importer.cc
src/google/protobuf/compiler/importer.cc
+3
-0
objectivec_helpers.cc
...google/protobuf/compiler/objectivec/objectivec_helpers.cc
+1
-1
plugin.cc
src/google/protobuf/compiler/plugin.cc
+1
-1
zero_copy_stream_impl.cc
src/google/protobuf/io/zero_copy_stream_impl.cc
+3
-0
zero_copy_stream_unittest.cc
src/google/protobuf/io/zero_copy_stream_unittest.cc
+3
-0
message_unittest.cc
src/google/protobuf/message_unittest.cc
+1
-1
io_win32.cc
src/google/protobuf/stubs/io_win32.cc
+2
-4
io_win32.h
src/google/protobuf/stubs/io_win32.h
+2
-2
file.cc
src/google/protobuf/testing/file.cc
+3
-0
googletest.cc
src/google/protobuf/testing/googletest.cc
+1
-1
No files found.
src/google/protobuf/compiler/command_line_interface.cc
View file @
564f02c9
...
...
@@ -108,7 +108,7 @@ namespace compiler {
#endif
namespace
{
#if defined(_
WIN32) && !defined(__CYGWIN__
)
#if defined(_
MSC_VER
)
// 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
::
access
;
...
...
src/google/protobuf/compiler/command_line_interface_unittest.cc
View file @
564f02c9
...
...
@@ -69,7 +69,7 @@ namespace google {
namespace
protobuf
{
namespace
compiler
{
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
// 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
::
access
;
...
...
src/google/protobuf/compiler/importer.cc
View file @
564f02c9
...
...
@@ -59,6 +59,9 @@
#ifdef _WIN32
#include <ctype.h>
#endif
#ifdef _MSC_VER
// 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
::
access
;
...
...
src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
View file @
564f02c9
...
...
@@ -50,7 +50,7 @@
#include <google/protobuf/stubs/io_win32.h>
#include <google/protobuf/stubs/strutil.h>
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
// 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
::
open
;
...
...
src/google/protobuf/compiler/plugin.cc
View file @
564f02c9
...
...
@@ -49,7 +49,7 @@
#include <google/protobuf/descriptor.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
// 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
::
setmode
;
...
...
src/google/protobuf/io/zero_copy_stream_impl.cc
View file @
564f02c9
...
...
@@ -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 <io.h>, instead create functions in io_win32.{h,cc} and import
// them like we do below.
using
google
::
protobuf
::
internal
::
win32
::
access
;
...
...
src/google/protobuf/io/zero_copy_stream_unittest.cc
View file @
564f02c9
...
...
@@ -83,6 +83,9 @@ namespace {
#ifdef _WIN32
#define pipe(fds) _pipe(fds, 4096, O_BINARY)
#endif
#ifdef _MSC_VER
// 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
::
access
;
...
...
src/google/protobuf/message_unittest.cc
View file @
564f02c9
...
...
@@ -63,7 +63,7 @@
namespace
google
{
namespace
protobuf
{
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
// 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
;
...
...
src/google/protobuf/stubs/io_win32.cc
View file @
564f02c9
...
...
@@ -39,15 +39,13 @@
//
// This file is only used on Windows, it's empty on other platforms.
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
// 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
// debug failing tests if that's caused by the long path support.
// Long path support is disabled in MinGW
#ifndef __MINGW32__
#define SUPPORT_LONGPATHS
#endif // !__MINGW32__
#include <ctype.h>
#include <direct.h>
...
...
@@ -361,5 +359,5 @@ wstring testonly_path_to_winpath(const string& path) {
}
// namespace protobuf
}
// namespace google
#endif // defined(_
WIN32
)
#endif // defined(_
MSC_VER
)
src/google/protobuf/stubs/io_win32.h
View file @
564f02c9
...
...
@@ -45,7 +45,7 @@
#ifndef GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
#define GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
#if defined(_
WIN32
)
#if defined(_
MSC_VER
)
#include <string>
#include <google/protobuf/stubs/port.h>
...
...
@@ -91,7 +91,7 @@ LIBPROTOBUF_EXPORT std::wstring testonly_path_to_winpath(
#define STDOUT_FILENO 1
#endif
#endif // defined(_
WIN32
)
#endif // defined(_
MSC_VER
)
#endif // GOOGLE_PROTOBUF_STUBS_IO_WIN32_H__
...
...
src/google/protobuf/testing/file.cc
View file @
564f02c9
...
...
@@ -55,6 +55,9 @@ namespace protobuf {
#define lstat stat
// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import
// them like we do below.
#endif
#ifdef _MSC_VER
using
google
::
protobuf
::
internal
::
win32
::
access
;
using
google
::
protobuf
::
internal
::
win32
::
chdir
;
using
google
::
protobuf
::
internal
::
win32
::
fopen
;
...
...
src/google/protobuf/testing/googletest.cc
View file @
564f02c9
...
...
@@ -52,7 +52,7 @@
namespace
google
{
namespace
protobuf
{
#ifdef _
WIN32
#ifdef _
MSC_VER
// 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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment