From 5ab106db7b091c6409fd0a7e43f557a7931c200f Mon Sep 17 00:00:00 2001 From: Eric Thorpe Date: Thu, 16 Mar 2017 09:40:31 +1100 Subject: [PATCH] Fix Building Using MSVC This patch enables the building of OpenVPN for the 2.4 and master branches using MSVC (Visual Studio 2013 / MSVC v120), which currently doesn't work with 2.4 or a clone of master. 2013 is being used as it reduces the complexity of the redistributable requirements and has mostly complete C99 support. Further changes will be necessary for 2015 support when the switch is made. Note the changes to config-msvc-version.h.in are more of a work around. It was a simpler approach when compared to modifying msvc-generate.js to handle m4 syntax, and so it may be dropped if there is an intention to update the javascript generator. Signed-off by: Eric Thorpe Acked-by: Gert Doering Message-Id: URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg14268.html Signed-off-by: Gert Doering --- config-msvc-version.h.in | 8 ++++++-- config-msvc.h | 1 + src/openvpn/openvpn.vcxproj | 7 +++++++ src/openvpn/openvpn.vcxproj.filters | 26 +++++++++++++++++++++++++- 4 files changed, 39 insertions(+), 3 deletions(-) diff --git a/config-msvc-version.h.in b/config-msvc-version.h.in index 4bc89e7b41d..7977cb84ec7 100644 --- a/config-msvc-version.h.in +++ b/config-msvc-version.h.in @@ -1,8 +1,12 @@ #define PACKAGE_NAME "@PRODUCT_NAME@" -#define PACKAGE_STRING "@PRODUCT_NAME@ @PRODUCT_VERSION@" +#define PACKAGE_STRING "@PRODUCT_NAME@ @PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@@PRODUCT_VERSION_PATCH@" #define PACKAGE_TARNAME "@PRODUCT_TARNAME@" #define PACKAGE "@PRODUCT_TARNAME@" -#define PACKAGE_VERSION "@PRODUCT_VERSION@" +#define PRODUCT_VERSION_MAJOR "@PRODUCT_VERSION_MAJOR@" +#define PRODUCT_VERSION_MINOR "@PRODUCT_VERSION_MINOR@" +#define PRODUCT_VERSION_PATCH "@PRODUCT_VERSION_PATCH@" +#define PACKAGE_VERSION "@PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@.@PRODUCT_VERSION_PATCH@" +#define PRODUCT_VERSION "@PRODUCT_VERSION_MAJOR@.@PRODUCT_VERSION_MINOR@.@PRODUCT_VERSION_PATCH@" #define PRODUCT_BUGREPORT "@PRODUCT_BUGREPORT@" #define OPENVPN_VERSION_RESOURCE @PRODUCT_VERSION_RESOURCE@ #define TAP_WIN_COMPONENT_ID "@PRODUCT_TAP_WIN_COMPONENT_ID@" diff --git a/config-msvc.h b/config-msvc.h index 3e71c854077..9b97e7121f6 100644 --- a/config-msvc.h +++ b/config-msvc.h @@ -126,6 +126,7 @@ typedef __int64 int64_t; typedef __int32 int32_t; typedef __int16 int16_t; typedef __int8 int8_t; +typedef uint16_t in_port_t; #ifdef HAVE_CONFIG_MSVC_LOCAL_H #include diff --git a/src/openvpn/openvpn.vcxproj b/src/openvpn/openvpn.vcxproj index 8dfbea520a9..d1c0fdec2a9 100644 --- a/src/openvpn/openvpn.vcxproj +++ b/src/openvpn/openvpn.vcxproj @@ -99,13 +99,16 @@ + + + @@ -164,12 +167,15 @@ + + + @@ -249,6 +255,7 @@ + diff --git a/src/openvpn/openvpn.vcxproj.filters b/src/openvpn/openvpn.vcxproj.filters index 8b6a2696204..30df5ec299f 100644 --- a/src/openvpn/openvpn.vcxproj.filters +++ b/src/openvpn/openvpn.vcxproj.filters @@ -216,6 +216,18 @@ Source Files + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -464,10 +476,22 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + Resource Files - + \ No newline at end of file