diff options
author | Jisi Liu <jisi.liu@gmail.com> | 2017-07-25 11:52:33 -0700 |
---|---|---|
committer | Jisi Liu <jisi.liu@gmail.com> | 2017-07-25 11:52:33 -0700 |
commit | 759245a49a00315a41b28da8fe52a2894d4f57ea (patch) | |
tree | 5a0032a1a3619a448d5301da131907ca8449730f /src/google/protobuf/compiler/importer.cc | |
parent | 4bff88e0fb2338657a781eeee0c5362a57b57bf3 (diff) | |
download | protobuf-759245a49a00315a41b28da8fe52a2894d4f57ea.tar.gz protobuf-759245a49a00315a41b28da8fe52a2894d4f57ea.tar.bz2 protobuf-759245a49a00315a41b28da8fe52a2894d4f57ea.zip |
Merge from master
Diffstat (limited to 'src/google/protobuf/compiler/importer.cc')
-rw-r--r-- | src/google/protobuf/compiler/importer.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/google/protobuf/compiler/importer.cc b/src/google/protobuf/compiler/importer.cc index a27562f7..4e86d787 100644 --- a/src/google/protobuf/compiler/importer.cc +++ b/src/google/protobuf/compiler/importer.cc @@ -34,7 +34,7 @@ #ifdef _MSC_VER -#include <io.h> +#include <direct.h> #else #include <unistd.h> #endif @@ -54,19 +54,21 @@ #include <google/protobuf/compiler/parser.h> #include <google/protobuf/io/tokenizer.h> #include <google/protobuf/io/zero_copy_stream_impl.h> +#include <google/protobuf/stubs/io_win32.h> #include <google/protobuf/stubs/strutil.h> -namespace google { -namespace protobuf { -namespace compiler { - #ifdef _WIN32 -#ifndef F_OK -#define F_OK 00 // not defined by MSVC for whatever reason -#endif #include <ctype.h> +// 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; +using google::protobuf::internal::win32::open; #endif +namespace google { +namespace protobuf { +namespace compiler { + // Returns true if the text looks like a Windows-style absolute path, starting // with a drive letter. Example: "C:\foo". TODO(kenton): Share this with // copy in command_line_interface.cc? |