Commit 7da1054564609f3382869714432f54b63812d083

Pali Rohár 2021-02-03T21:00:56

Define ULONG_PTR for older SDK If compiling with _WIN32_WINNT target prior 0x0500 then SDK does not define ULONG_PTR type. Such systems are only 32bit so define it explicitly to 32bit type ULONG.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/dlfcn.c b/src/dlfcn.c
index 394ee19..c4f410d 100644
--- a/src/dlfcn.c
+++ b/src/dlfcn.c
@@ -33,6 +33,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+/* Older versions do not have this type */
+#if _WIN32_WINNT < 0x0500
+typedef ULONG ULONG_PTR;
+#endif
+
 /* Older SDK versions do not have these macros */
 #ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
 #define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 0x4