]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10167: Fixed bug with ks_pool_resize allocating incorrectly based on recent alloca...
authorShane Bryldt <astaelan@gmail.com>
Mon, 3 Apr 2017 20:53:28 +0000 (14:53 -0600)
committerShane Bryldt <astaelan@gmail.com>
Mon, 3 Apr 2017 20:53:28 +0000 (14:53 -0600)
libs/libblade/libblade.sln
libs/libblade/src/include/blade.h
libs/libblade/test/blades.vcxproj [new file with mode: 0644]
libs/libks/src/ks_pool.c
w32/config-version.props [new file with mode: 0644]
w32/config.props [new file with mode: 0644]
w32/sodium-version.props [new file with mode: 0644]
w32/sodium.props [new file with mode: 0644]

index 4e79f883b82e834c46ee9b5c0030f242da738d7b..54989dbc28a6118706194d11a33a0a30dc5cea1b 100644 (file)
@@ -17,6 +17,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsodium", "..\win32\libso
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libconfig", "..\win32\libconfig\libconfig.2015.vcxproj", "{1A234565-926D-49B2-83E4-D56E0C38C9F2}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blades", "test\blades.vcxproj", "{636D5B57-FC64-4A18-8D42-54209F8886BD}"
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|x64 = Debug|x64
@@ -141,6 +143,22 @@ Global
                {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64
                {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.ActiveCfg = ReleaseDLL|Win32
                {1A234565-926D-49B2-83E4-D56E0C38C9F2}.ReleaseDLL|x86.Build.0 = ReleaseDLL|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x64.ActiveCfg = Debug|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x64.Build.0 = Debug|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x86.ActiveCfg = Debug|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Debug|x86.Build.0 = Debug|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x64.ActiveCfg = Debug|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x64.Build.0 = Debug|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x86.ActiveCfg = Debug|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.DebugDLL|x86.Build.0 = Debug|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x64.ActiveCfg = Release|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x64.Build.0 = Release|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x86.ActiveCfg = Release|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.Release|x86.Build.0 = Release|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x64.ActiveCfg = Release|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x64.Build.0 = Release|x64
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x86.ActiveCfg = Release|Win32
+               {636D5B57-FC64-4A18-8D42-54209F8886BD}.ReleaseDLL|x86.Build.0 = Release|Win32
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index b79242c709fd01876960964f5efc8cb6b33ba92c..f2b527689e080bdbd6ce51b1f10d8a863901d951 100644 (file)
@@ -53,7 +53,7 @@
 
 KS_BEGIN_EXTERN_C
 
-#ifndef config_lookup_from
+#ifdef _WIN32
 #define config_lookup_from config_setting_lookup
 #endif
 
diff --git a/libs/libblade/test/blades.vcxproj b/libs/libblade/test/blades.vcxproj
new file mode 100644 (file)
index 0000000..a4fdf90
--- /dev/null
@@ -0,0 +1,215 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.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>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{636D5B57-FC64-4A18-8D42-54209F8886BD}</ProjectGuid>
+    <Keyword>Win32Proj</Keyword>
+    <RootNamespace>blades</RootNamespace>
+    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>true</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <UseDebugLibraries>false</UseDebugLibraries>
+    <PlatformToolset>v140</PlatformToolset>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Label="Shared">
+  </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" />
+    <Import Project="..\..\..\w32\openssl-version.props" />
+    <Import Project="..\..\..\w32\sodium.props" />
+    <Import Project="..\..\..\w32\config.props" />
+  </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" />
+    <Import Project="..\..\..\w32\openssl-version.props" />
+    <Import Project="..\..\..\w32\sodium.props" />
+    <Import Project="..\..\..\w32\config.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\w32\openssl-version.props" />
+    <Import Project="..\..\..\w32\sodium.props" />
+    <Import Project="..\..\..\w32\config.props" />
+  </ImportGroup>
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+    <Import Project="..\..\..\w32\openssl-version.props" />
+    <Import Project="..\..\..\w32\sodium.props" />
+    <Import Project="..\..\..\w32\config.props" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <LinkIncremental>true</LinkIncremental>
+    <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IncludePath>$(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(SolutionDir)\openssl\include;$(IncludePath)</IncludePath>
+    <LibraryPath>$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <LinkIncremental>true</LinkIncremental>
+    <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <IncludePath>$(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(SolutionDir)\openssl\include64;$(IncludePath)</IncludePath>
+    <LibraryPath>$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <LinkIncremental>false</LinkIncremental>
+    <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IncludePath>$(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(SolutionDir)\openssl\include;$(IncludePath)</IncludePath>
+    <LibraryPath>$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <LinkIncremental>false</LinkIncremental>
+    <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
+    <IncludePath>$(SolutionDir);$(SolutionDir)..\libks\src\include;$(SolutionDir)..\libsodium-$(SodiumVersion)\src\libsodium\include;$(SolutionDir)..\libconfig-$(ConfigVersion)\lib;$(SolutionDir)\openssl\include64;$(IncludePath)</IncludePath>
+    <LibraryPath>$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x86;../src/include;.</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4090</DisableSpecificWarnings>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <MinimalRebuild>false</MinimalRebuild>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x64;../src/include;.</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4090</DisableSpecificWarnings>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <MinimalRebuild>false</MinimalRebuild>
+    </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>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x86;../src/include;.</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4090</DisableSpecificWarnings>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <WarningLevel>Level3</WarningLevel>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <Optimization>MaxSpeed</Optimization>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <SDLCheck>true</SDLCheck>
+      <AdditionalIncludeDirectories>$(SolutionDir)..\win32\openssl\include;$(SolutionDir)..\win32\openssl\include_x64;../src/include;.</AdditionalIncludeDirectories>
+      <DisableSpecificWarnings>4090</DisableSpecificWarnings>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+    </ClCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>
+      <OptimizeReferences>true</OptimizeReferences>
+    </Link>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="tap.c" />
+    <ClCompile Include="blades.c" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\libks\libks.vcxproj">
+      <Project>{70d178d8-1100-4152-86c0-809a91cff832}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\win32\libconfig\libconfig.2015.vcxproj">
+      <Project>{1a234565-926d-49b2-83e4-d56e0c38c9f2}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\win32\libsodium\libsodium.2015.vcxproj">
+      <Project>{a185b162-6cb6-4502-b03f-b56f7699a8d9}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\win32\openssl\libeay32.2015.vcxproj">
+      <Project>{d331904d-a00a-4694-a5a3-fcff64ab5dbe}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\win32\openssl\ssleay32.2015.vcxproj">
+      <Project>{b4b62169-5ad4-4559-8707-3d933ac5db39}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\libblade.vcxproj">
+      <Project>{a89d6d18-6203-4149-9051-f8e798e7a3e7}</Project>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
\ No newline at end of file
index 17a40b99537e83fb5b282b3c2178a2cb0353c39a..2b0b12d112cc816eaabbfda71b303e58cbe8530a 100644 (file)
@@ -1833,7 +1833,34 @@ KS_DECLARE(void *) ks_pool_resize_ex(ks_pool_t *mp_p, void *old_addr, const unsi
                return NULL;
        }
 
-       old_byte_size = prefix->size;
+       old_byte_size = prefix->size - PREFIX_SIZE - FENCE_SIZE - prefix->padding;
+
+       if (old_byte_size == new_byte_size) {
+               SET_POINTER(error_p, KS_STATUS_SUCCESS);
+               new_addr = old_addr;
+               goto end;
+       }
+
+       if (old_byte_size >= new_byte_size) {
+               unsigned long diff = old_byte_size - new_byte_size;
+               //prefix->size -= diff;
+               prefix->padding += diff;
+               write_magic((char *)prefix + prefix->size - prefix->padding - FENCE_SIZE);
+               SET_POINTER(error_p, KS_STATUS_SUCCESS);
+               new_addr = old_addr;
+               goto end;
+       }
+
+       {
+               unsigned long diff = new_byte_size - old_byte_size;
+               if (prefix->padding >= diff) {
+                       prefix->padding -= diff;
+                       write_magic((char *)prefix + prefix->size - prefix->padding - FENCE_SIZE);
+                       SET_POINTER(error_p, KS_STATUS_SUCCESS);
+                       new_addr = old_addr;
+                       goto end;
+               }
+       }
 
        /*
         * If the size is larger than a block then the allocation must be at
diff --git a/w32/config-version.props b/w32/config-version.props
new file mode 100644 (file)
index 0000000..1bd8fe7
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros">
+    <ConfigVersion>1.5</ConfigVersion>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ConfigVersionImported>true</ConfigVersionImported>
+  </PropertyGroup>
+  <PropertyGroup />
+  <ItemDefinitionGroup />
+  <ItemGroup>
+    <BuildMacro Include="ConfigVersion">
+      <Value>$(ConfigVersion)</Value>
+    </BuildMacro>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/w32/config.props b/w32/config.props
new file mode 100644 (file)
index 0000000..52e60c1
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets">
+    <Import Project="config-version.props" Condition=" '$(ConfigVersionImported)' == ''"/>
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <ConfigPropsImported>true</ConfigPropsImported>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\libconfig-$(ConfigVersion)\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <PreprocessorDefinitions>LIBCONFIG_EXPORTS;YY_NO_UNISTD_H;YY_USE_CONST;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup />
+</Project>
diff --git a/w32/sodium-version.props b/w32/sodium-version.props
new file mode 100644 (file)
index 0000000..a63082b
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets" />
+  <PropertyGroup Label="UserMacros">
+    <SodiumVersion>1.0.12</SodiumVersion>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SodiumVersionImported>true</SodiumVersionImported>
+  </PropertyGroup>
+  <PropertyGroup />
+  <ItemDefinitionGroup />
+  <ItemGroup>
+    <BuildMacro Include="SodiumVersion">
+      <Value>$(SodiumVersion)</Value>
+    </BuildMacro>
+  </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/w32/sodium.props b/w32/sodium.props
new file mode 100644 (file)
index 0000000..a5700a1
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ImportGroup Label="PropertySheets">
+    <Import Project="sodium-version.props" Condition=" '$(SodiumVersionImported)' == ''"/>
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <SodiumPropsImported>true</SodiumPropsImported>
+  </PropertyGroup>
+  <ItemDefinitionGroup>
+    <ClCompile>
+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\libsodium-$(SodiumVersion)\src\libsodium\include\sodium;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <MultiProcessorCompilation>true</MultiProcessorCompilation>
+      <PreprocessorDefinitions>UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>NATIVE_LITTLE_ENDIAN=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup />
+</Project>