Commit d1ce7a28 authored by kenton@google.com's avatar kenton@google.com

Fix build on MSVC.

parent f2a73293
...@@ -34,11 +34,18 @@ ...@@ -34,11 +34,18 @@
#include <iostream> #include <iostream>
#include <set> #include <set>
#include <unistd.h>
#ifdef _WIN32 #ifdef _WIN32
#include <io.h> #include <io.h>
#include <fcntl.h> #include <fcntl.h>
#ifndef STDIN_FILENO
#define STDIN_FILENO 0
#endif
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
#else
#include <unistd.h>
#endif #endif
#include <google/protobuf/stubs/common.h> #include <google/protobuf/stubs/common.h>
......
...@@ -34,11 +34,18 @@ ...@@ -34,11 +34,18 @@
// command_line_interface_unittest. // command_line_interface_unittest.
#include <string> #include <string>
#include <stdlib.h>
#include <google/protobuf/compiler/plugin.h> #include <google/protobuf/compiler/plugin.h>
#include <google/protobuf/compiler/mock_code_generator.h> #include <google/protobuf/compiler/mock_code_generator.h>
#include <google/protobuf/stubs/strutil.h> #include <google/protobuf/stubs/strutil.h>
int main(int argc, char* argv[]) { 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"); google::protobuf::compiler::MockCodeGenerator generator("test_plugin");
return google::protobuf::compiler::PluginMain(argc, argv, &generator); return google::protobuf::compiler::PluginMain(argc, argv, &generator);
} }
...@@ -794,7 +794,7 @@ TEST_F(RepeatedPtrFieldPtrsIteratorTest, PtrSTLAlgorithms_lower_bound) { ...@@ -794,7 +794,7 @@ TEST_F(RepeatedPtrFieldPtrsIteratorTest, PtrSTLAlgorithms_lower_bound) {
string v = "f"; string v = "f";
RepeatedPtrField<string>::pointer_iterator it = RepeatedPtrField<string>::pointer_iterator it =
lower_bound(proto_array_.pointer_begin(), proto_array_.pointer_end(), lower_bound(proto_array_.pointer_begin(), proto_array_.pointer_end(),
v, StringLessThan()); &v, StringLessThan());
GOOGLE_CHECK(*it != NULL); GOOGLE_CHECK(*it != NULL);
......
...@@ -151,6 +151,10 @@ ...@@ -151,6 +151,10 @@
RelativePath="..\src\google\protobuf\io\coded_stream.h" RelativePath="..\src\google\protobuf\io\coded_stream.h"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\io\coded_stream_inl.h"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\stubs\common.h" RelativePath="..\src\google\protobuf\stubs\common.h"
> >
......
...@@ -151,6 +151,10 @@ ...@@ -151,6 +151,10 @@
RelativePath="..\src\google\protobuf\io\coded_stream.h" RelativePath="..\src\google\protobuf\io\coded_stream.h"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\io\coded_stream_inl.h"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\stubs\common.h" RelativePath="..\src\google\protobuf\stubs\common.h"
> >
......
...@@ -155,6 +155,18 @@ ...@@ -155,6 +155,18 @@
RelativePath="..\src\google\protobuf\compiler\command_line_interface.h" RelativePath="..\src\google\protobuf\compiler\command_line_interface.h"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\compiler\subprocess.h"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\plugin.h"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\plugin.pb.h"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\compiler\cpp\cpp_enum.h" RelativePath="..\src\google\protobuf\compiler\cpp\cpp_enum.h"
> >
...@@ -271,6 +283,18 @@ ...@@ -271,6 +283,18 @@
RelativePath="..\src\google\protobuf\compiler\command_line_interface.cc" RelativePath="..\src\google\protobuf\compiler\command_line_interface.cc"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\compiler\subprocess.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\plugin.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\plugin.pb.cc"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\compiler\cpp\cpp_enum.cc" RelativePath="..\src\google\protobuf\compiler\cpp\cpp_enum.cc"
> >
......
This diff is collapsed.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="test_plugin"
ProjectGUID="{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}"
RootNamespace="test_plugin"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=""
Outputs=""
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305"
Optimization="0"
AdditionalIncludeDirectories="../src;.;../gtest/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
Description=""
CommandLine=""
AdditionalDependencies=""
Outputs=""
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/wd4244 /wd4267 /wd4018 /wd4355 /wd4800 /wd4251 /wd4996 /wd4146 /wd4305"
AdditionalIncludeDirectories="../src;.;../gtest/include"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;"
RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
>
<File
RelativePath="..\src\google\protobuf\compiler\mock_code_generator.h"
>
</File>
<File
RelativePath="..\src\google\protobuf\testing\file.h"
>
</File>
</Filter>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
>
<File
RelativePath="..\src\google\protobuf\compiler\test_plugin.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\mock_code_generator.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\testing\file.cc"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
...@@ -194,6 +194,10 @@ ...@@ -194,6 +194,10 @@
RelativePath="..\src\google\protobuf\test_util.h" RelativePath="..\src\google\protobuf\test_util.h"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\compiler\mock_code_generator.h"
>
</File>
<File <File
RelativePath=".\google\protobuf\unittest.pb.h" RelativePath=".\google\protobuf\unittest.pb.h"
> >
...@@ -222,6 +226,10 @@ ...@@ -222,6 +226,10 @@
RelativePath=".\google\protobuf\unittest_optimize_for.pb.h" RelativePath=".\google\protobuf\unittest_optimize_for.pb.h"
> >
</File> </File>
<File
RelativePath=".\google\protobuf\unittest_no_generic_services.pb.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Resource Files" Name="Resource Files"
...@@ -242,6 +250,10 @@ ...@@ -242,6 +250,10 @@
RelativePath="..\src\google\protobuf\compiler\command_line_interface_unittest.cc" RelativePath="..\src\google\protobuf\compiler\command_line_interface_unittest.cc"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\compiler\mock_code_generator.cc"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\stubs\common_unittest.cc" RelativePath="..\src\google\protobuf\stubs\common_unittest.cc"
> >
...@@ -258,6 +270,18 @@ ...@@ -258,6 +270,18 @@
RelativePath="..\src\google\protobuf\compiler\cpp\cpp_unittest.cc" RelativePath="..\src\google\protobuf\compiler\cpp\cpp_unittest.cc"
> >
</File> </File>
<File
RelativePath="..\src\google\protobuf\compiler\cpp\cpp_plugin_unittest.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\java\java_plugin_unittest.cc"
>
</File>
<File
RelativePath="..\src\google\protobuf\compiler\python\python_plugin_unittest.cc"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\descriptor_database_unittest.cc" RelativePath="..\src\google\protobuf\descriptor_database_unittest.cc"
> >
...@@ -362,6 +386,10 @@ ...@@ -362,6 +386,10 @@
RelativePath=".\google\protobuf\unittest_optimize_for.pb.cc" RelativePath=".\google\protobuf\unittest_optimize_for.pb.cc"
> >
</File> </File>
<File
RelativePath=".\google\protobuf\unittest_no_generic_services.pb.cc"
>
</File>
<File <File
RelativePath="..\src\google\protobuf\unknown_field_set_unittest.cc" RelativePath="..\src\google\protobuf\unknown_field_set_unittest.cc"
> >
...@@ -567,6 +595,30 @@ ...@@ -567,6 +595,30 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="..\src\google\protobuf\unittest_no_generic_services.proto"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating unittest_no_generic_services.pb.{h,cc}..."
CommandLine="Debug\protoc -I../src --cpp_out=. ../src/google/protobuf/unittest_no_generic_services.proto&#x0D;&#x0A;"
Outputs="google\protobuf\unittest_no_generic_services.pb.h;google\protobuf\unittest_no_generic_services.pb.cc"
/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCustomBuildTool"
Description="Generating unittest_no_generic_services.pb.{h,cc}..."
CommandLine="Release\protoc -I../src --cpp_out=. ../src/google/protobuf/unittest_no_generic_services.proto&#x0D;&#x0A;"
Outputs="google\protobuf\unittest_no_generic_services.pb.h;google\protobuf\unittest_no_generic_services.pb.cc"
/>
</FileConfiguration>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment