Commit e1d593d967ccb3f1efe8d60889e0d2c1f8b6d855

Pali Rohár 2020-08-04T18:35:01

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 <stdlib.h>