Instead of for specific architectures. Fixes setjmp on ARM64EC.
---
v2: Reorder checks to simplify the code a bit. We could probably simplify it 
further
by removing defined(__SEH__) checks.

 mingw-w64-headers/crt/setjmp.h | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/mingw-w64-headers/crt/setjmp.h b/mingw-w64-headers/crt/setjmp.h
index 2dc7d8739..8bfab5c58 100644
--- a/mingw-w64-headers/crt/setjmp.h
+++ b/mingw-w64-headers/crt/setjmp.h
@@ -229,16 +229,14 @@ void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp 
(void);
 #    define longjmp __mingw_longjmp
   int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) 
__mingw_setjmp(jmp_buf _Buf);
   __MINGW_ATTRIB_NORETURN __attribute__ ((__nothrow__)) void 
__mingw_longjmp(jmp_buf _Buf,int _Value);
-#  elif defined(__SEH__) && !defined(__USE_MINGW_SETJMP_NON_SEH)
-#    if defined(__aarch64__) || defined(_ARM64_) || defined(__arm__) || 
defined(_ARM_)
-#      define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
-#    elif (__MINGW_GCC_VERSION < 40702) && !defined(__clang__)
-#      define setjmp(BUF) _setjmp((BUF), mingw_getsp())
-#    else
-#      define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
-#    endif
-#  else
+#  elif !defined(__SEH__) || defined(__USE_MINGW_SETJMP_NON_SEH)
 #    define setjmp(BUF) _setjmp((BUF), NULL)
+#  elif __has_builtin(__builtin_sponentry)
+#    define setjmp(BUF) _setjmp((BUF), __builtin_sponentry())
+#  elif (__MINGW_GCC_VERSION < 40702) && !defined(__clang__)
+#    define setjmp(BUF) _setjmp((BUF), mingw_getsp())
+#  else
+#    define setjmp(BUF) _setjmp((BUF), __builtin_frame_address (0))
 #  endif
   int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf 
_Buf, void *_Ctx);
   int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp3(jmp_buf 
_Buf, void *_Ctx);
-- 
2.49.0



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to