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"
> >
......
...@@ -20,6 +20,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests.vcproj", "{4 ...@@ -20,6 +20,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "tests.vcproj", "{4
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} {3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}
{3AF54C8A-10BF-4332-9147-F68ED9862032} = {3AF54C8A-10BF-4332-9147-F68ED9862032} {3AF54C8A-10BF-4332-9147-F68ED9862032} = {3AF54C8A-10BF-4332-9147-F68ED9862032}
{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32} = {CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}
{1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}
EndProjectSection EndProjectSection
EndProject EndProject
...@@ -35,6 +36,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lite-test", "lite-test.vcpr ...@@ -35,6 +36,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lite-test", "lite-test.vcpr
{1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} {1738D5F6-ED1E-47E0-B2F0-456864B93C1E} = {1738D5F6-ED1E-47E0-B2F0-456864B93C1E}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_plugin", "test_plugin.vcproj", "{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}"
ProjectSection(ProjectDependencies) = postProject
{B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE} = {B84FF31A-5F9A-46F8-AB22-DBFC9BECE3BE}
{3E283F37-A4ED-41B7-A3E6-A2D89D131A30} = {3E283F37-A4ED-41B7-A3E6-A2D89D131A30}
{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
...@@ -73,6 +81,10 @@ Global ...@@ -73,6 +81,10 @@ Global
{12015ACE-42BE-4952-A5A0-44A9A46908E2}.Debug|Win32.Build.0 = Debug|Win32 {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Debug|Win32.Build.0 = Debug|Win32
{12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.ActiveCfg = Release|Win32 {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.ActiveCfg = Release|Win32
{12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.Build.0 = Release|Win32 {12015ACE-42BE-4952-A5A0-44A9A46908E2}.Release|Win32.Build.0 = Release|Win32
{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}.Debug|Win32.ActiveCfg = Debug|Win32
{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}.Debug|Win32.Build.0 = Debug|Win32
{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}.Release|Win32.ActiveCfg = Release|Win32
{CBBD34E5-02B0-40D5-B6D8-BFEA83E18B32}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
<?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