From a050993f51790ebe4959820b2210d68a5dd523f6 Mon Sep 17 00:00:00 2001 From: hasherezade Date: Sat, 30 May 2026 15:04:05 +0200 Subject: [PATCH] [BUGFIX] Fixe compatibility with MinGW. Added dbghelp to linked libs --- CMakeLists.txt | 1 + utils/process_symbols.h | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d6b3892..9d2f0373 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -328,6 +328,7 @@ set (used_libs ntdll.lib shlwapi imagehlp + dbghelp ) # dependencies diff --git a/utils/process_symbols.h b/utils/process_symbols.h index 1fc9fe0c..7d131105 100644 --- a/utils/process_symbols.h +++ b/utils/process_symbols.h @@ -6,6 +6,12 @@ #include #include "dbg_help_wrapper.h" +#ifdef _MSC_VER + #define ALIGNED8 __declspec(align(8)) +#else + #define ALIGNED8 __attribute__((aligned(8))) +#endif + //--- class ProcessSymbolsManager { @@ -246,7 +252,7 @@ public: return ""; } - __declspec(align(8)) char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME] = { 0 }; + ALIGNED8 char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME] = { 0 }; PSYMBOL_INFO symbol = reinterpret_cast(buffer); symbol->SizeOfStruct = sizeof(SYMBOL_INFO); @@ -274,7 +280,7 @@ public: return false; } - __declspec(align(8)) char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME ] = { 0 }; + ALIGNED8 char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME ] = { 0 }; PSYMBOL_INFO symbol = reinterpret_cast(buffer); symbol->SizeOfStruct = sizeof(SYMBOL_INFO);