From b1f368221654847e4ede6b6fa6d3461135ff36c3 Mon Sep 17 00:00:00 2001 From: Carlo Bramini Date: Mon, 3 Jun 2024 19:45:20 +0200 Subject: [PATCH] SDL_assert: add support for aarch64-w64-mingw32 GCC 15 development branch provides an experimental support for Windows on ARM64, which will be officially released next year, according to latest news. I tried to compile SDL2 with this new compiler but I got a tiny problem into SDL_assert.h because it couldn't find the right platform. However, it has been easy to fix and I included it into this PR. More details can be also found here: https://learn.microsoft.com/en-us/cpp/intrinsics/debugbreak?view=msvc-170 (cherry picked from commit 2cb1a2d0a7f1c9cb3177c907758322899c3041d5) --- include/SDL3/SDL_assert.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/SDL3/SDL_assert.h b/include/SDL3/SDL_assert.h index 1b74e0430e..e88fd1e858 100644 --- a/include/SDL3/SDL_assert.h +++ b/include/SDL3/SDL_assert.h @@ -139,6 +139,8 @@ extern "C" { #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" ) #elif defined(SDL_PLATFORM_APPLE) && defined(__arm__) #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "bkpt #22\n\t" ) +#elif defined(_WIN32) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__arm64__) || defined(__aarch64__)) ) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #0xF000\n\t" ) #elif defined(__386__) && defined(__WATCOMC__) #define SDL_TriggerBreakpoint() { _asm { int 0x03 } } #elif defined(HAVE_SIGNAL_H) && !defined(__WATCOMC__)