]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix win32 building with C99 mode
authorGert Doering <gert@greenie.muc.de>
Sun, 18 Sep 2016 12:14:23 +0000 (14:14 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 18 Sep 2016 20:10:11 +0000 (22:10 +0200)
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 <gert@greenie.muc.de>
Acked-by: Selva Nair <selva.nair@gmail.com>
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 <gert@greenie.muc.de>
src/openvpn/block_dns.c
src/openvpn/misc.c
src/openvpnserv/Makefile.am

index af2db1892c9b342874eff1cacc30dadb5dc03171..ee20c6812b4b9f2c6f463801055e7c875c55e60b 100644 (file)
  *  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 <fwpmu.h>
index 0991d791707c3503d74e70efb085af040cf47cb9..2982cd0d195f3941c475254900a169bdc51e306e 100644 (file)
@@ -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
index 3c757d644f0655dbb4d969938b8fb0cda5558f28..3521a342e04298c2bd2ae5e29070533e62f8db7c 100644 (file)
@@ -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