Browse code

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 <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>

Gert Doering authored on 2016/09/18 21:14:23
Showing 3 changed files
... ...
@@ -24,6 +24,17 @@
24 24
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
25 25
  */
26 26
 
27
+#ifdef HAVE_CONFIG_H
28
+#include "config.h"
29
+#elif defined(_MSC_VER)
30
+#include "config-msvc.h"
31
+#endif
32
+#ifdef HAVE_CONFIG_VERSION_H
33
+#include "config-version.h"
34
+#endif
35
+
36
+#include "syshead.h"
37
+
27 38
 #ifdef WIN32
28 39
 
29 40
 #include <fwpmu.h>
... ...
@@ -977,7 +977,7 @@ hostname_randomize(const char *hostname, struct gc_arena *gc)
977 977
 const char *
978 978
 gen_path (const char *directory, const char *filename, struct gc_arena *gc)
979 979
 {
980
-#if WIN32
980
+#ifdef WIN32
981 981
   const int CC_PATH_RESERVED = CC_LESS_THAN|CC_GREATER_THAN|CC_COLON|
982 982
     CC_DOUBLE_QUOTE|CC_SLASH|CC_BACKSLASH|CC_PIPE|CC_QUESTION_MARK|CC_ASTERISK;
983 983
 #else
... ...
@@ -18,7 +18,7 @@ EXTRA_DIST = \
18 18
 	openvpnserv.vcxproj.filters
19 19
 
20 20
 AM_CPPFLAGS = \
21
-	-I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn
21
+	-I$(top_srcdir)/include -I$(top_srcdir)/src/openvpn -I$(top_srcdir)/src/compat
22 22
 
23 23
 if WIN32
24 24
 sbin_PROGRAMS = openvpnserv