Oliver Schneider avatar Oliver Schneider committed baff498

- Making bspatch also compile

Comments (0)

Files changed (7)

 #include <sys/types.h>
 
 #include <bzlib.h>
-#ifndef _WIN32
+#if !(defined(_MSC_VER) && (_MSC_VER >= 1400) && defined(_WIN32))
 #include <err.h>
-#endif // _WIN32
+#else
+#include "win32msvc_glue.c"
+#endif // _WIN32 && _MSC_VER
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if defined(_MSC_VER) && (_MSC_VER >= 1400) && defined(_WIN32)
-#include "win32msvc_glue.c"
-#else
+#if !(defined(_MSC_VER) && (_MSC_VER >= 1400) && defined(_WIN32))
 #include <unistd.h>
 #define _tmain main
 #define _TCHAR char
 
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
-Project("{65EA10E0-CDE5-4D11-AB27-FB2F8A5CF70B}") = "bsdiff", "bsdiff.vs8.vcproj", "{5369FD2B-048D-4765-AB52-2EABC55C2B7E}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bsdiff", "bsdiff.vs8.vcproj", "{5369FD2B-048D-4765-AB52-2EABC55C2B7E}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bspatch", "bspatch.vs8.vcproj", "{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Debug|Win32.Build.0 = Debug|Win32
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Release|Win32.ActiveCfg = Release|Win32
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Release|Win32.Build.0 = Release|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Debug|Win32.Build.0 = Debug|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Release|Win32.ActiveCfg = Release|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 # Visual Studio 2008
 Project("{65EA10E0-CDE5-4D11-AB27-FB2F8A5CF70B}") = "bsdiff", "bsdiff.vs9.vcproj", "{5369FD2B-048D-4765-AB52-2EABC55C2B7E}"
 EndProject
+Project("{65EA10E0-CDE5-4D11-AB27-FB2F8A5CF70B}") = "bspatch", "bspatch.vs9.vcproj", "{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Debug|Win32.Build.0 = Debug|Win32
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Release|Win32.ActiveCfg = Release|Win32
 		{5369FD2B-048D-4765-AB52-2EABC55C2B7E}.Release|Win32.Build.0 = Release|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Debug|Win32.ActiveCfg = Debug|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Debug|Win32.Build.0 = Debug|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Release|Win32.ActiveCfg = Release|Win32
+		{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}.Release|Win32.Build.0 = Release|Win32
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#if !(defined(_MSC_VER) && (_MSC_VER >= 1400) && defined(_WIN32))
 #include <err.h>
 #include <unistd.h>
+#define _tmain main
+#define _TCHAR char
+#else
+#include "win32msvc_glue.c"
+#endif // _WIN32 && _MSC_VER
 #include <fcntl.h>
 
 static off_t offtin(u_char *buf)
 	return y;
 }
 
-int main(int argc,char * argv[])
+int _tmain(int argc,_TCHAR * argv[])
 {
 	FILE * f, * cpf, * dpf, * epf;
 	BZFILE * cpfbz2, * dpfbz2, * epfbz2;

bspatch.vs8.vcproj

+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="bspatch"
+	ProjectGUID="{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}"
+	RootNamespace="bspatch"
+	Keyword="Win32Proj"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="intermediate\vs8_$(ProjectName)32_$(ConfigurationName)"
+			IntermediateDirectory="$(OutDir)"
+			ConfigurationType="1"
+			UseOfMFC="1"
+			CharacterSet="1"
+			BuildLogFile="BuildLog_$(TargetName).html"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;bzip2"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalOptions="/nologo"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="bin\$(ProjectName)32_dbg.exe"
+				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="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="intermediate\vs8_$(ProjectName)32_$(ConfigurationName)"
+			IntermediateDirectory="$(OutDir)"
+			ConfigurationType="1"
+			UseOfMFC="1"
+			CharacterSet="1"
+			BuildLogFile="BuildLog_$(TargetName).html"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;bzip2"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalOptions="/nologo"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="bin\$(ProjectName)32.exe"
+				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="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;def;asm;mc"
+			>
+			<File
+				RelativePath=".\bspatch.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+					/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="bzip2"
+				>
+				<File
+					RelativePath=".\bzip2\blocksort.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\bzlib.c"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath=".\bzip2\compress.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\crctable.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\decompress.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\huffman.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\randtable.c"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx"
+			>
+			<File
+				RelativePath=".\buildnumber.h"
+				>
+			</File>
+			<File
+				RelativePath=".\execommon.h"
+				>
+			</File>
+			<File
+				RelativePath=".\exeversion.h"
+				>
+			</File>
+			<Filter
+				Name="bzip2"
+				>
+				<File
+					RelativePath=".\bzip2\bzlib.h"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\bzlib_private.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;mc;ico;cur;bmp;dlg;rc2"
+			>
+			<File
+				RelativePath=".\exeversion.rc"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>

bspatch.vs9.vcproj

+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="bspatch"
+	ProjectGUID="{D532FA33-1C7E-49CD-9121-5DD0E1873B2F}"
+	RootNamespace="bspatch"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="0"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="intermediate\vs9_$(ProjectName)32_$(ConfigurationName)"
+			IntermediateDirectory="$(OutDir)"
+			ConfigurationType="1"
+			UseOfMFC="1"
+			CharacterSet="1"
+			BuildLogFile="BuildLog_$(TargetName).html"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories=".;bzip2"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalOptions="/nologo"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="bin\$(ProjectName)32_dbg.exe"
+				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="intermediate\vs9_$(ProjectName)32_$(ConfigurationName)"
+			IntermediateDirectory="$(OutDir)"
+			ConfigurationType="1"
+			UseOfMFC="1"
+			CharacterSet="1"
+			BuildLogFile="BuildLog_$(TargetName).html"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories=".;bzip2"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				AdditionalOptions="/nologo"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				OutputFile="bin\$(ProjectName)32.exe"
+				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="Source Files"
+			Filter="cpp;c;cxx;def;asm;mc"
+			>
+			<File
+				RelativePath=".\bspatch.c"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+					/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="bzip2"
+				>
+				<File
+					RelativePath=".\bzip2\blocksort.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\bzlib.c"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath=".\bzip2\compress.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\crctable.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\decompress.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\huffman.c"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\randtable.c"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx"
+			>
+			<File
+				RelativePath=".\buildnumber.h"
+				>
+			</File>
+			<File
+				RelativePath=".\execommon.h"
+				>
+			</File>
+			<File
+				RelativePath=".\exeversion.h"
+				>
+			</File>
+			<Filter
+				Name="bzip2"
+				>
+				<File
+					RelativePath=".\bzip2\bzlib.h"
+					>
+				</File>
+				<File
+					RelativePath=".\bzip2\bzlib_private.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="rc;mc;ico;cur;bmp;dlg;rc2"
+			>
+			<File
+				RelativePath=".\exeversion.rc"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
 #include <tchar.h>
 #include <io.h>
 #include <stdarg.h>
+#include <sys/types.h>
+
+typedef signed __int64 ssize_t;
 
 static off_t ftello(FILE *stream)
 {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.