From d1ce7a2839dbc3b882d9fb8fc01f69ebbfbd0cfd Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Mon, 21 Dec 2009 21:19:05 +0000 Subject: Fix build on MSVC. --- src/google/protobuf/compiler/plugin.cc | 9 ++++++++- src/google/protobuf/compiler/test_plugin.cc | 7 +++++++ src/google/protobuf/repeated_field_unittest.cc | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/google/protobuf/compiler/plugin.cc b/src/google/protobuf/compiler/plugin.cc index 4757652f..a4aedafb 100644 --- a/src/google/protobuf/compiler/plugin.cc +++ b/src/google/protobuf/compiler/plugin.cc @@ -34,11 +34,18 @@ #include #include -#include #ifdef _WIN32 #include #include +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +#define STDOUT_FILENO 1 +#endif +#else +#include #endif #include diff --git a/src/google/protobuf/compiler/test_plugin.cc b/src/google/protobuf/compiler/test_plugin.cc index 75fdca0d..5cbbf3d9 100644 --- a/src/google/protobuf/compiler/test_plugin.cc +++ b/src/google/protobuf/compiler/test_plugin.cc @@ -34,11 +34,18 @@ // command_line_interface_unittest. #include +#include #include #include #include int main(int argc, char* argv[]) { +#ifdef _MSC_VER + // Don't print a silly message or stick a modal dialog box in my face, + // please. + _set_abort_behavior(0, ~0); +#endif // !_MSC_VER + google::protobuf::compiler::MockCodeGenerator generator("test_plugin"); return google::protobuf::compiler::PluginMain(argc, argv, &generator); } diff --git a/src/google/protobuf/repeated_field_unittest.cc b/src/google/protobuf/repeated_field_unittest.cc index cd9ca8a9..7c35f604 100644 --- a/src/google/protobuf/repeated_field_unittest.cc +++ b/src/google/protobuf/repeated_field_unittest.cc @@ -794,7 +794,7 @@ TEST_F(RepeatedPtrFieldPtrsIteratorTest, PtrSTLAlgorithms_lower_bound) { string v = "f"; RepeatedPtrField::pointer_iterator it = lower_bound(proto_array_.pointer_begin(), proto_array_.pointer_end(), - v, StringLessThan()); + &v, StringLessThan()); GOOGLE_CHECK(*it != NULL); -- cgit v1.2.3