wintun/api/entry.h
Jason A. Donenfeld 1201c9f346 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>
2020-11-03 02:25:57 +01:00

39 lines
829 B
C

/* SPDX-License-Identifier: GPL-2.0
*
* Copyright (C) 2018-2020 WireGuard LLC. All Rights Reserved.
*/
#pragma once
#include <Windows.h>
#ifndef __L
# define __L(x) L##x
#endif
#ifndef _L
# 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 1
#else
# define MAYBE_WOW64 0
#endif
#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;
extern SECURITY_ATTRIBUTES SecurityAttributes;