diff options
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | include/CommonAPI/Types.hpp | 10 |
2 files changed, 13 insertions, 0 deletions
@@ -1,6 +1,9 @@ Changes ======= +v3.1.10.1 +- Fixed crash on dlclose() + v3.1.10 - no changes diff --git a/include/CommonAPI/Types.hpp b/include/CommonAPI/Types.hpp index 6f6801d..4cdff5d 100644 --- a/include/CommonAPI/Types.hpp +++ b/include/CommonAPI/Types.hpp @@ -53,11 +53,21 @@ namespace CommonAPI { static void __cdecl f(void); \ __declspec(allocate(".CRT$XCU")) void(__cdecl*f##_)(void) = f; \ static void __cdecl f(void) +#define DEINITIALIZER(f) \ + static void __cdecl f(void); \ + static void _##f##_wrapper(void) { \ + atexit(f); \ + } \ + __declspec(allocate(".CRT$XCU")) void(__cdecl * f##_)(void) = _##f##_wrapper; \ + static void __cdecl f(void) #else #define CCALL #define INITIALIZER(f) \ static void f(void) __attribute__((constructor)); \ static void f(void) +#define DEINITIALIZER(f) \ + static void f(void) __attribute__((destructor)); \ + static void f(void) #endif namespace CommonAPI { |