From 5ff25beec7ad7fb229b943ecb86fe55bcad531c4 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 31 Aug 2015 14:39:23 -0700 Subject: The official #define for 32-bit and 64-bit Windows is _WIN32. It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that. --- gencode.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'gencode.c') diff --git a/gencode.c b/gencode.c index 552c40a1..2caf66ed 100644 --- a/gencode.c +++ b/gencode.c @@ -24,9 +24,9 @@ #include "config.h" #endif -#ifdef WIN32 +#ifdef _WIN32 #include -#else /* WIN32 */ +#else /* _WIN32 */ #if HAVE_INTTYPES_H #include #elif HAVE_STDINT_H @@ -37,7 +37,7 @@ #endif #include #include -#endif /* WIN32 */ +#endif /* _WIN32 */ /* * XXX - why was this included even on UNIX? @@ -46,7 +46,7 @@ #include "ip6_misc.h" #endif -#ifndef WIN32 +#ifndef _WIN32 #ifdef __NetBSD__ #include @@ -55,7 +55,7 @@ #include #include -#endif /* WIN32 */ +#endif /* _WIN32 */ #include #include @@ -95,9 +95,9 @@ #define offsetof(s, e) ((size_t)&((s *)0)->e) #endif #ifdef INET6 -#ifndef WIN32 +#ifndef _WIN32 #include /* for "struct addrinfo" */ -#endif /* WIN32 */ +#endif /* _WIN32 */ #endif /*INET6*/ #include @@ -136,7 +136,7 @@ static jmp_buf top_ctx; static pcap_t *bpf_pcap; /* Hack for handling VLAN and MPLS stacks. */ -#ifdef WIN32 +#ifdef _WIN32 static u_int label_stack_depth = (u_int)-1, vlan_stack_depth = (u_int)-1; #else static u_int label_stack_depth = -1U, vlan_stack_depth = -1U; @@ -440,7 +440,7 @@ pcap_compile(pcap_t *p, struct bpf_program *program, * UN*X, if the platform supports pthreads? If that requires * a separate -lpthread, we might not want to do that. */ -#ifdef WIN32 +#ifdef _WIN32 extern int wsockinit (void); static int done = 0; @@ -515,7 +515,7 @@ pcap_compile(pcap_t *p, struct bpf_program *program, quit: -#ifdef WIN32 +#ifdef _WIN32 LeaveCriticalSection(&g_PcapCompileCriticalSection); #endif -- cgit v1.2.3