aboutsummaryrefslogtreecommitdiffstats
path: root/api/entry.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 02:09:00 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 02:25:57 +0100
commit1201c9f346f1e9b2bc00b0a9854fc6e182e851ef (patch)
tree7a404f1a14c3fbb258bb11b464c72dcb15f319d3 /api/entry.h
parentapi: begin to separate rundll32 jumps (diff)
downloadwintun-1201c9f346f1e9b2bc00b0a9854fc6e182e851ef.tar.xz
wintun-1201c9f346f1e9b2bc00b0a9854fc6e182e851ef.zip
api: ensure more code compiles by using dead code elimination
It'd be nicer to do this via if (is_defined(HAVE_WHATEVER)) But MSVC won't work with the linux kernel macros for this. Ongoing research. Nevertheless, this makes most of the program always pass through the compiler's type checker, only to have dead code removed later. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'api/entry.h')
-rw-r--r--api/entry.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/api/entry.h b/api/entry.h
index 0e0e3a6..e60dd71 100644
--- a/api/entry.h
+++ b/api/entry.h
@@ -14,12 +14,24 @@
# define _L(x) __L(x)
#endif
+/* TODO: Replace with is_defined. MSVC has issues with the linux kernel varadic macro trick for this. */
#if defined(_M_IX86) || defined(_M_ARM)
-#define MAYBE_WOW64
+# define MAYBE_WOW64 1
+#else
+# define MAYBE_WOW64 0
#endif
-#if defined(_M_AMD64) || defined(_M_ARM64) || defined(_DEBUG)
-#define ACCEPT_WOW64
+#if defined(_M_AMD64) || defined(_M_ARM64)
+# define ACCEPT_WOW64 1
+#else
+# define ACCEPT_WOW64 0
#endif
+#ifdef HAVE_WHQL
+# undef HAVE_WHQL
+# define HAVE_WHQL 1
+#else
+# define HAVE_WHQL 0
+#endif
+#pragma warning(disable : 4127) /* conditional expression is constant */
extern HINSTANCE ResourceModule;
extern HANDLE ModuleHeap;