Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Commit

Permalink
add visual studio compiler support
Browse files Browse the repository at this point in the history
  • Loading branch information
bugparty committed Apr 30, 2014
1 parent 3304d48 commit 5022959
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
*.swn

# Other build artifacts
/Debug
/visualc/Debug
/visualc/Release
/visualc/gumbo.sdf
/visualc/gumbo.opensdf
/build
.log
.sdf
.opensdf
.deps
.dirstamp
.libs
Expand Down
4 changes: 3 additions & 1 deletion src/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@

#ifndef GUMBO_ERROR_H_
#define GUMBO_ERROR_H_

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdint.h>

#include "gumbo.h"
Expand Down
5 changes: 5 additions & 0 deletions src/gumbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
#ifndef GUMBO_GUMBO_H_
#define GUMBO_GUMBO_H_

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define fileno _fileno
#endif

#include <stdbool.h>
#include <stddef.h>

Expand Down
6 changes: 5 additions & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@

#ifndef GUMBO_UTIL_H_
#define GUMBO_UTIL_H_

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif
#include <stdbool.h>
#include <stddef.h>



#ifdef __cplusplus
extern "C" {
#endif
Expand Down
106 changes: 106 additions & 0 deletions visualc/gumbo.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.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>{2661FA5E-ACC3-4D27-8FD2-9DBB0414EEDC}</ProjectGuid>
<RootNamespace>gumbo</RootNamespace>
<ProjectName>gumbo</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<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'">
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);./include</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<IncludePath>./include;$(VC_IncludePath);$(WindowsSDK_IncludePath);</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>false</SDLCheck>
<BufferSecurityCheck>false</BufferSecurityCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\src\attribute.c" />
<ClCompile Include="..\src\char_ref.c" />
<ClCompile Include="..\src\error.c" />
<ClCompile Include="..\src\parser.c" />
<ClCompile Include="..\src\string_buffer.c" />
<ClCompile Include="..\src\string_piece.c" />
<ClCompile Include="..\src\tag.c" />
<ClCompile Include="..\src\tokenizer.c" />
<ClCompile Include="..\src\utf8.c" />
<ClCompile Include="..\src\util.c" />
<ClCompile Include="..\src\vector.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\strings.h" />
<ClInclude Include="..\src\attribute.h" />
<ClInclude Include="..\src\char_ref.h" />
<ClInclude Include="..\src\error.h" />
<ClInclude Include="..\src\gumbo.h" />
<ClInclude Include="..\src\insertion_mode.h" />
<ClInclude Include="..\src\parser.h" />
<ClInclude Include="..\src\string_buffer.h" />
<ClInclude Include="..\src\string_piece.h" />
<ClInclude Include="..\src\tokenizer.h" />
<ClInclude Include="..\src\tokenizer_states.h" />
<ClInclude Include="..\src\token_type.h" />
<ClInclude Include="..\src\utf8.h" />
<ClInclude Include="..\src\util.h" />
<ClInclude Include="..\src\vector.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
99 changes: 99 additions & 0 deletions visualc/gumbo.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?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;hh;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="..\src\attribute.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\char_ref.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\error.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\parser.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\string_buffer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\string_piece.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\tag.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\tokenizer.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\utf8.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\util.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vector.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\attribute.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\char_ref.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\error.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\gumbo.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\insertion_mode.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\parser.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\string_buffer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\string_piece.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\token_type.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\tokenizer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\tokenizer_states.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\utf8.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\util.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vector.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\strings.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions visualc/gumbo.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
3 changes: 3 additions & 0 deletions visualc/include/strings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*Dummy file to satisfy source file dependencies on Windows platform*/
#define strcasecmp _stricmp
#define strncasecmp _strnicmp

0 comments on commit 5022959

Please sign in to comment.