From: Marcus Eggenberger Date: Tue, 11 Nov 2008 23:29:38 +0000 (+0100) Subject: As dbghelp.dll/lib uses different APIs depending on it's version, we "elegantly"... X-Git-Tag: 0.3.1~47 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=c806d8e92f2ccbc2886ffe6257f7597e28c355dd As dbghelp.dll/lib uses different APIs depending on it's version, we "elegantly" *cough* work around that issue... --- diff --git a/src/common/logbacktrace_win.cpp b/src/common/logbacktrace_win.cpp index 779e5cbe..5c9a420c 100644 --- a/src/common/logbacktrace_win.cpp +++ b/src/common/logbacktrace_win.cpp @@ -49,11 +49,7 @@ struct EnumModulesContext { EnumModulesContext(HANDLE hProcess, QTextStream &stream) : hProcess(hProcess), stream(stream) {} }; -#if _MSC_VER >= 1500 BOOL CALLBACK EnumModulesCB(PCTSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) { -#else -BOOL CALLBACK EnumModulesCB(PSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) { -#endif IMAGEHLP_MODULE64 mod; EnumModulesContext *context = (EnumModulesContext *)UserContext; mod.SizeOfStruct = sizeof(IMAGEHLP_MODULE64); @@ -74,6 +70,11 @@ BOOL CALLBACK EnumModulesCB(PSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContex return TRUE; } +// we don't use the ModuleName anyways so we can easily "convert" this +inline BOOL CALLBACK EnumModulesCB(PSTR ModuleName, DWORD64 BaseOfDll, PVOID UserContext) { + return EnumModulesCB(PCTSTR(0), BaseOfDll, UserContext); +} + #ifdef _M_IX86 // Disable global optimization and ignore /GS waning caused by // inline assembly.