From 6cd7e08d89cc9c39d00989866fb4782d5e7041dc Mon Sep 17 00:00:00 2001 From: Gert Doering Date: Sun, 18 Sep 2016 14:14:23 +0200 Subject: [PATCH] Fix win32 building with C99 mode In -std=c99 mode, WIN32 is not defined to be "1" anymore, but just "#define WIN32" - so the "#if WIN32" breaks, needs to be "#ifdef WIN32" v2: also fix block_dns.c (include config.h + compat.h) (Selva Nair) Signed-off-by: Gert Doering Acked-by: Selva Nair Message-Id: <20160918121423.52139-1-gert@greenie.muc.de> URL: http://www.mail-archive.com/search?l=mid&q=20160918121423.52139-1-gert@greenie.muc.de Signed-off-by: Gert Doering --- src/openvpn/block_dns.c | 11 +++++++++++ src/openvpn/misc.c | 2 +- src/openvpnserv/Makefile.am | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/openvpn/block_dns.c b/src/openvpn/block_dns.c index af2db1892..ee20c6812 100644 --- a/src/openvpn/block_dns.c +++ b/src/openvpn/block_dns.c @@ -24,6 +24,17 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#elif defined(_MSC_VER) +#include "config-msvc.h" +#endif +#ifdef HAVE_CONFIG_VERSION_H +#include "config-version.h" +#endif + +#include "syshead.h" + #ifdef WIN32 #include diff --git a/src/openvpn/misc.c b/src/openvpn/misc.c index 0991d7917..2982cd0d1 100644 --- a/src/openvpn/misc.c +++ b/src/openvpn/misc.c @@ -977,7 +977,7 @@ hostname_randomize(const char *hostname, struct gc_arena *gc) const char * gen_path (const char *directory, const char *filename, struct gc_arena *gc) { -#if WIN32 +#ifdef WIN32 const int CC_PATH_RESERVED = CC_LESS_THAN|CC_GREATER_THAN|CC_COLON| CC_DOUBLE_QUOTE|CC_SLASH|CC_BACKSLASH|CC_PIPE|CC_QUESTION_MARK|CC_ASTERISK; #else diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am index 3c757d644..3521a342e 100644 --- a/src/openvpnserv/Makefile.am +++ b/src/openvpnserv/Makefile.am @@ -18,7 +18,7 @@ EXTRA_DIST = \ openvpnserv.vcxproj.filters AM_CPPFLAGS = \ - -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn + -I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat if WIN32 sbin_PROGRAMS = openvpnserv -- 2.47.2