This fixes MSVS 2013 compilation.
PATCH 1/1 This fixes MSVS 2013 compilation.
* Tools version changed to 12
* Added comp.c/h and compat.c/h to project files
* Workaround for missing __attribute__ support
Also, as a preparation for MSVS2015, ensured that snprintf is not defined for that VS version.
--- config-msvc.h | 3 +++ src/compat/compat.vcxproj | 6 ++++-- src/openvpn/openvpn.vcxproj | 10 ++++++++-- src/openvpn/syshead.h | 1 + src/openvpnserv/openvpnserv.vcxproj | 6 ++++-- 5 files changed, 20 insertions(+), 6 deletions(-)
config-msvc.h +3 -0
@@ -90,7 +90,10 @@#define strncasecmp strnicmp#define strcasecmp _stricmp + +#if _MSC_VER<1900 #define snprintf _snprintf +#endif #if _MSC_VER <1800 #define strtoull strtoul
src/compat/compat.vcxproj +4 -2
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration>
@@ -20,10 +20,12 @@ <ConfigurationType>StaticLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings">
@@ -84,4 +86,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
src/openvpn/openvpn.vcxproj +8 -2
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration>
@@ -20,10 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>Unicode</CharacterSet> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings">
@@ -100,6 +102,8 @@ <ClCompile Include="base64.c" /> <ClCompile Include="buffer.c" /> <ClCompile Include="clinat.c" /> + <ClCompile Include="comp.c" /> + <ClCompile Include="compstub.c" /> <ClCompile Include="console.c" /> <ClCompile Include="crypto.c" /> <ClCompile Include="crypto_openssl.c" />
@@ -168,6 +172,8 @@ <ClInclude Include="buffer.h" /> <ClInclude Include="circ_list.h" /> <ClInclude Include="clinat.h" /> + <ClInclude Include="comp.h" /> + <ClInclude Include="compstub.h" /> <ClInclude Include="common.h" /> <ClInclude Include="console.h" /> <ClInclude Include="crypto.h" />
@@ -260,4 +266,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
src/openvpn/syshead.h +1 -0
@@ -47,6 +47,7 @@#ifdef _MSC_VER// Visual Studio #define __func__ __FUNCTION__ +#define __attribute__ (x)#endif #if defined(__APPLE__)
src/openvpnserv/openvpnserv.vcxproj +4 -2
@@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration>
@@ -20,10 +20,12 @@ <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> <WholeProgramOptimization>true</WholeProgramOptimization> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v120</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings">
@@ -109,4 +111,4 @@ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
Signature · 1 line
1.9.1
Hi,
Quoted 1 line · Lev Stipakov
* Tools version changed to 12
What exactly does this do? ("I should understand the side effects" :) )
Quoted 1 line
* Added comp.c/h and compat.c/h to project files
The description is wrong, as it is compstub.c/.h - I'll fix this on merging, so no need to re-send.
Did you also test building with the GetIpRoute2() patch in
http://thread.gmane.org/gmane.network.openvpn.devel/10085 ? I'd like to merge that, but it might break MSVC compilation due to the stray typedef (which is needed because MinGW headers are incomplete in that respect)
thanks,
gert
Signature · 4 lines
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]...
fax: +49-89-35655025 [email protected]...ACK.
Your patch has been applied to the master branch.
commit 123092a7a95f13f0509d2dc52ec049f91a02686d
Author: Lev Stipakov Date: Fri Oct 2 14:46:41 2015 +0300
This fixes MSVS 2013 compilation.
Acked-by: Gert Doering <[email protected]...>
Message-Id: <[email protected]...>
URL: http://article.gmane.org/gmane.network.openvpn.devel/10174
Signed-off-by: Gert Doering <[email protected]...>--
kind regards,
Gert Doering