فهرست منبع

Fix the "redundant redeclaration" warning for `__debugbreak` when using MinGW (#14264)

Roman Fomin 23 ساعت پیش
والد
کامیت
b0a9aa3db0
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      include/SDL3/SDL_assert.h

+ 4 - 1
include/SDL3/SDL_assert.h

@@ -126,10 +126,13 @@ extern "C" {
  */
 #define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
 
-#elif defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1310)
+#elif defined(_MSC_VER) && _MSC_VER >= 1310
     /* Don't include intrin.h here because it contains C++ code */
     extern void __cdecl __debugbreak(void);
     #define SDL_TriggerBreakpoint() __debugbreak()
+#elif defined(__MINGW32__)
+    #include <intrin.h>
+    #define SDL_TriggerBreakpoint() __debugbreak()
 #elif defined(_MSC_VER) && defined(_M_IX86)
     #define SDL_TriggerBreakpoint() { _asm { int 0x03 }  }
 #elif SDL_HAS_BUILTIN(__builtin_debugtrap)