From: Tobias Brunner Date: Thu, 10 Nov 2022 12:44:21 +0000 (+0100) Subject: backtrace: Fix build with newer MinGW versions X-Git-Tag: 5.9.9rc1~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2bf110d9f8c7736f60690cb7a6854a672abc8ea3;p=thirdparty%2Fstrongswan.git backtrace: Fix build with newer MinGW versions A recent change added CALLBACK to PENUM_PAGE_FILE_CALLBACKW/A in psapi.h, which conflicts with our own macro of the same name. Our compat/windows.h header undefs the Windows definition, but that only works if Windows headers are included before ours, which wasn't the case for psapi.h. --- diff --git a/src/libstrongswan/utils/backtrace.c b/src/libstrongswan/utils/backtrace.c index b93be1ed6f..30f19cb156 100644 --- a/src/libstrongswan/utils/backtrace.c +++ b/src/libstrongswan/utils/backtrace.c @@ -15,23 +15,20 @@ */ #define _GNU_SOURCE +#include #ifdef HAVE_BACKTRACE -# include +#include #endif /* HAVE_BACKTRACE */ + +#ifdef WIN32 +#include +#include #ifdef HAVE_DBGHELP -# include -# include -# include +#include #endif /* HAVE_DBGHELP */ -#include - -#include "backtrace.h" -#include - -#ifdef WIN32 -# include +#include /* missing in MinGW */ #ifdef WIN64 #ifndef GetModuleInformation @@ -47,6 +44,10 @@ DWORD K32GetModuleFileNameExA(HANDLE hProcess, HMODULE hModule, #endif /* WIN64 */ #endif +#include "backtrace.h" + +#include + typedef struct private_backtrace_t private_backtrace_t; /**