From 8bfb0e9e5942e070a4d61a47e8facc482c14800d Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 9 Oct 2018 22:52:50 +0000 Subject: Trying to address the Appveyor issues with lua-winreg - We now define KEY_WOW64_32KEY and KEY_WOW64_64KEY locally, if on MinGW - We use variadic macros on VS2005 and newer as well as on MinGW instead of the NOP_FUNCTION construct --- src/win_trace.h | 8 +++++++- src/winreg.c | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/win_trace.h b/src/win_trace.h index d2e2114..d5e1e5c 100644 --- a/src/win_trace.h +++ b/src/win_trace.h @@ -17,7 +17,13 @@ extern "C" { #endif #include -#ifdef NDEBUG +#if defined(NDEBUG) && (defined(__MINGW32__) || (defined(_MSC_VER) && (_MSC_VER >= 1400))) + #define WIN_TRACET(...) do {} while(0) + #define WIN_TRACEA(...) do {} while(0) + #define WIN_TRACEW(...) do {} while(0) + #define WIN_TRACEA_FT(...) do {} while(0) + #define WIN_TRACEA_ST(...) do {} while(0) +#elif defined(NDEBUG) && defined(_MSC_VER) && (_MSC_VER < 1400) #define WIN_TRACET NOP_FUNCTION #define WIN_TRACEA NOP_FUNCTION #define WIN_TRACEW NOP_FUNCTION diff --git a/src/winreg.c b/src/winreg.c index 87b518a..775c158 100644 --- a/src/winreg.c +++ b/src/winreg.c @@ -39,6 +39,13 @@ #define REG_QWORD ( 11 ) // 64-bit number #endif +#if !defined(KEY_WOW64_32KEY) && defined(__MINGW32__) +#define KEY_WOW64_32KEY (0x0200) +#endif +#if !defined(KEY_WOW64_64KEY) && defined(__MINGW32__) +#define KEY_WOW64_64KEY (0x0100) +#endif + #ifndef LUA_REG_NO_DLL BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved){ UNUSED(hModule); -- cgit v1.2.3