1. Rupert Wood
  2. seek-bzip2-vc10

Commits

Rupert Wood  committed bf3e906

Trivial compile changes to build with MSVC++10

  • Participants
  • Parent commits 68ba278
  • Branches seek-bzip2

Comments (0)

Files changed (7)

File .hgignore

View file
  • Ignore whitespace
+Debug
+_ReSharper.seek-bzip2
+ipch
+seek-bzip2.*.ReSharper.user
+seek-bzip2.sdf
+seek-bzip2.suo
+seek-bzip2.vcxproj.user

File micro-bunzip.c

View file
  • Ignore whitespace
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <limits.h>
+#include <sys/types.h>
 
 /* Constants for huffman coding */
 #define MAX_GROUPS   6

File micro-bunzip.h

View file
  • Ignore whitespace
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <limits.h>
+#include <sys/types.h>
 
 /* Constants for huffman coding */
 #define MAX_GROUPS   6
 /* ---- Forward declarations for micro-bzip.c ---------------------------- */
 
 extern int get_next_block( bunzip_data *bd );
+extern unsigned int get_bits( bunzip_data *bd, char bits_wanted );
+extern int read_bunzip( bunzip_data *bd, char *outbuf, int len );
+extern int start_bunzip( bunzip_data **bdp, int in_fd, char *inbuf, int len );
 
 #endif

File seek-bunzip.c

View file
  • Ignore whitespace
+#include <io.h>
 #include <setjmp.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+#include <sys/types.h>
+#include <fcntl.h>
 
 #include "micro-bunzip.h"
 
     char n_bit = pos % 8;
 
     // Seek the underlying file descriptor
-    if ( lseek( bd->in_fd, n_byte, SEEK_SET ) != n_byte )
+    if ( _lseek( bd->in_fd, n_byte, SEEK_SET ) != n_byte )
     {
         return -1;
     }
             }
             else
             {
-                write( 1, outbuf, gotcount );
+                _write( 1, outbuf, gotcount );
             }
         }
     }
 int main( int argc, char *argv[] )
 {
     unsigned long pos = atol( argv[1] );
-    int status = uncompressblock( 0, pos );
+    int status;
+    _setmode(0, _O_BINARY);
+    _setmode(1, _O_BINARY);
+    status = uncompressblock( 0, pos );
     if ( status )
         fprintf( stderr, "\n%s\n", bunzip_errors[-status] );
-}
+}

File seek-bzip2.sln

View file
  • Ignore whitespace
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "seek-bzip2", "seek-bzip2.vcxproj", "{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}.Debug|Win32.ActiveCfg = Debug|Win32
+		{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}.Debug|Win32.Build.0 = Debug|Win32
+		{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}.Release|Win32.ActiveCfg = Release|Win32
+		{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

File seek-bzip2.vcxproj

View file
  • Ignore whitespace
+<?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>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{16DA96F3-32B8-42AD-9DDE-73F09E43AB91}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>seekbzip2</RootNamespace>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</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>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="micro-bunzip.c" />
+    <ClCompile Include="seek-bunzip.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="micro-bunzip.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>

File seek-bzip2.vcxproj.filters

View file
  • Ignore whitespace
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup>
+    <Filter Include="Source Files">
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+    </Filter>
+    <Filter Include="Header Files">
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+    </Filter>
+    <Filter Include="Resource Files">
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+    </Filter>
+  </ItemGroup>
+  <ItemGroup>
+    <ClCompile Include="seek-bunzip.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="micro-bunzip.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="micro-bunzip.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+  </ItemGroup>
+</Project>