Since clang 3.4, __debugbreak is limited to -fms-extensions
and thus not available by default when targeting mingw.

The clang versioning ifdefs only work properly when on
vanilla clang; the clang shipped by Apple as part of Xcode
doesn't indicate what upstream clang version it corresponds
to, but the latest version e.g. reports __clang_major__ == 9.

Few users will probably use such a clang for building with
mingw-w64, but in case they do, it'd only be an issue for
older Xcode releases that correspond to upstream clang < 3.4.

Signed-off-by: Martin Storsjö <[email protected]>
---
 mingw-w64-headers/crt/_mingw.h.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index c5f3bf8..89b69c3 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -535,7 +535,7 @@ extern "C" {
 #endif
 
 #ifdef __MINGW_INTRIN_INLINE
-#if !defined (__clang__)
+#if !defined (__clang__) || (__clang_major__ > 3 || __clang_major__ == 3 && 
__clang_minor__ >= 4)
 void __cdecl __debugbreak(void);
 __MINGW_INTRIN_INLINE void __cdecl __debugbreak(void)
 {
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to