THRIFT-1031 Patch to compile Thrift for vc++ 9.0 and 10.0
=> some more improvements

Patch: James Dickson

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1174801 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/compiler.sln b/compiler/cpp/compiler.sln
new file mode 100644
index 0000000..94961aa
--- /dev/null
+++ b/compiler/cpp/compiler.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compiler", "compiler.vcxproj", "{89975A1A-F799-4556-98B8-64E30AB39A90}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.ActiveCfg = Debug|Win32
+		{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.Build.0 = Debug|Win32
+		{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.ActiveCfg = Release|Win32
+		{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
diff --git a/compiler/cpp/compiler.vcxproj b/compiler/cpp/compiler.vcxproj
new file mode 100644
index 0000000..5f43577
--- /dev/null
+++ b/compiler/cpp/compiler.vcxproj
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="src\generate\t_generator.h" />
+    <ClInclude Include="src\generate\t_generator_registry.h" />
+    <ClInclude Include="src\generate\t_oop_generator.h" />
+    <ClInclude Include="src\globals.h" />
+    <ClInclude Include="src\main.h" />
+    <ClInclude Include="src\md5.h" />
+    <ClInclude Include="src\parse\t_base_type.h" />
+    <ClInclude Include="src\parse\t_const.h" />
+    <ClInclude Include="src\parse\t_const_value.h" />
+    <ClInclude Include="src\parse\t_container.h" />
+    <ClInclude Include="src\parse\t_doc.h" />
+    <ClInclude Include="src\parse\t_enum.h" />
+    <ClInclude Include="src\parse\t_enum_value.h" />
+    <ClInclude Include="src\parse\t_field.h" />
+    <ClInclude Include="src\parse\t_function.h" />
+    <ClInclude Include="src\parse\t_list.h" />
+    <ClInclude Include="src\parse\t_map.h" />
+    <ClInclude Include="src\parse\t_program.h" />
+    <ClInclude Include="src\parse\t_scope.h" />
+    <ClInclude Include="src\parse\t_service.h" />
+    <ClInclude Include="src\parse\t_set.h" />
+    <ClInclude Include="src\parse\t_struct.h" />
+    <ClInclude Include="src\parse\t_type.h" />
+    <ClInclude Include="src\parse\t_typedef.h" />
+    <ClInclude Include="src\platform.h" />
+    <ClInclude Include="src\thrifty.h" />
+    <ClInclude Include="src\windows\config.h" />
+    <ClInclude Include="src\windows\version.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="src\generate\t_as3_generator.cc" />
+    <ClCompile Include="src\generate\t_cocoa_generator.cc" />
+    <ClCompile Include="src\generate\t_cpp_generator.cc" />
+    <ClCompile Include="src\generate\t_csharp_generator.cc" />
+    <ClCompile Include="src\generate\t_c_glib_generator.cc" />
+    <ClCompile Include="src\generate\t_erl_generator.cc" />
+    <ClCompile Include="src\generate\t_generator.cc" />
+    <ClCompile Include="src\generate\t_go_generator.cc" />
+    <ClCompile Include="src\generate\t_hs_generator.cc" />
+    <ClCompile Include="src\generate\t_html_generator.cc" />
+    <ClCompile Include="src\generate\t_javame_generator.cc" />
+    <ClCompile Include="src\generate\t_java_generator.cc" />
+    <ClCompile Include="src\generate\t_js_generator.cc" />
+    <ClCompile Include="src\generate\t_ocaml_generator.cc" />
+    <ClCompile Include="src\generate\t_perl_generator.cc" />
+    <ClCompile Include="src\generate\t_php_generator.cc" />
+    <ClCompile Include="src\generate\t_py_generator.cc" />
+    <ClCompile Include="src\generate\t_rb_generator.cc" />
+    <ClCompile Include="src\generate\t_st_generator.cc" />
+    <ClCompile Include="src\generate\t_xsd_generator.cc" />
+    <ClCompile Include="src\main.cc" />
+    <ClCompile Include="src\md5.c" />
+    <ClCompile Include="src\parse\parse.cc" />
+    <ClCompile Include="src\thriftl.cc" />
+    <ClCompile Include="src\thrifty.cc" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="README_WINDOWS" />
+    <None Include="src\thriftl.ll" />
+    <None Include="src\thrifty.yy" />
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{89975A1A-F799-4556-98B8-64E30AB39A90}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>compiler</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>MultiByte</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <TargetName>thrift</TargetName>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
+    <TargetName>thrift</TargetName>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsCpp</CompileAs>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <PreBuildEvent>
+      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
+bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
+      <CompileAs>CompileAsCpp</CompileAs>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+    <PreBuildEvent>
+      <Command>flex -o "src/thriftl.cc" src/thriftl.ll
+bison -y -o "src/thrifty.cc" --defines="src/thrifty.h" src/thrifty.yy</Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/compiler/cpp/compiler.vcxproj.filters b/compiler/cpp/compiler.vcxproj.filters
new file mode 100644
index 0000000..16a690f
--- /dev/null
+++ b/compiler/cpp/compiler.vcxproj.filters
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <ClInclude Include="src\main.h" />
+    <ClInclude Include="src\windows\version.h">
+      <Filter>windows</Filter>
+    </ClInclude>
+    <ClInclude Include="src\windows\config.h">
+      <Filter>windows</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_base_type.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_const.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_const_value.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_container.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_doc.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_enum.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_enum_value.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_field.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_function.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_list.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_map.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_program.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_scope.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_service.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_set.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_struct.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_type.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\parse\t_typedef.h">
+      <Filter>parse</Filter>
+    </ClInclude>
+    <ClInclude Include="src\generate\t_generator.h">
+      <Filter>generate</Filter>
+    </ClInclude>
+    <ClInclude Include="src\generate\t_generator_registry.h">
+      <Filter>generate</Filter>
+    </ClInclude>
+    <ClInclude Include="src\generate\t_oop_generator.h">
+      <Filter>generate</Filter>
+    </ClInclude>
+    <ClInclude Include="src\globals.h" />
+    <ClInclude Include="src\md5.h" />
+    <ClInclude Include="src\platform.h" />
+    <ClInclude Include="src\thrifty.h">
+      <Filter>generated</Filter>
+    </ClInclude>
+  </ItemGroup>
+  <ItemGroup>
+    <Filter Include="windows">
+      <UniqueIdentifier>{ae9d0a15-57ae-4f01-87a4-81f790249b83}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="resources">
+      <UniqueIdentifier>{c9be9380-57bb-438a-a647-4a6943326d6b}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="generated">
+      <UniqueIdentifier>{79697fe7-fdf0-4ed4-bb4f-3128632c3446}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="parse">
+      <UniqueIdentifier>{5df016bb-591b-420a-a535-4330d9187fbf}</UniqueIdentifier>
+    </Filter>
+    <Filter Include="generate">
+      <UniqueIdentifier>{b5c626af-afa5-433c-8e10-ee734533cb68}</UniqueIdentifier>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="src\main.cc" />
+    <ClCompile Include="src\parse\parse.cc">
+      <Filter>parse</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_as3_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_c_glib_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_cocoa_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_cpp_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_csharp_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_erl_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_hs_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_html_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_java_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_javame_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_js_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_ocaml_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_perl_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_php_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_rb_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_st_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_xsd_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\md5.c" />
+    <ClCompile Include="src\thriftl.cc">
+      <Filter>generated</Filter>
+    </ClCompile>
+    <ClCompile Include="src\thrifty.cc">
+      <Filter>generated</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_go_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+    <ClCompile Include="src\generate\t_py_generator.cc">
+      <Filter>generate</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="src\thriftl.ll">
+      <Filter>resources</Filter>
+    </None>
+    <None Include="src\thrifty.yy">
+      <Filter>resources</Filter>
+    </None>
+    <None Include="README_WINDOWS" />
+  </ItemGroup>
+</Project>
\ No newline at end of file