From e1d593d967ccb3f1efe8d60889e0d2c1f8b6d855 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Tue, 4 Aug 2020 18:35:01 +0200 Subject: Fix compilation with older environments This change should fix following compile error: dlfcn.c: In function 'dlsym': dlfcn.c:374:14: warning: implicit declaration of function 'GetModuleHandleExA' dlfcn.c: undefined reference to `GetModuleHandleExA' Documentation for function GetModuleHandleExA() says: To compile an application that uses this function, define _WIN32_WINNT as 0x0501 or later. Fixes: https://github.com/dlfcn-win32/dlfcn-win32/issues/75 --- dlfcn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlfcn.c b/dlfcn.c index a45a619..6f5da80 100644 --- a/dlfcn.c +++ b/dlfcn.c @@ -19,6 +19,9 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifndef _WIN32_WINNT +#define _WIN32_WINNT 0x0501 +#endif #ifdef _DEBUG #define _CRTDBG_MAP_ALLOC #include -- cgit v1.2.3-55-g6feb