From b44e4e09dd3eb44ff9698641120ef87a1a3d07d1 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Sun, 16 Apr 2023 20:11:56 +0200 Subject: [PATCH] Don't use builtin for clang as they are not properly supported. --- m-try.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/m-try.h b/m-try.h index 56b098a9..0dde7fc1 100644 --- a/m-try.h +++ b/m-try.h @@ -243,10 +243,11 @@ namespace m_lib { */ #else -#if (M_USE_TRY_MECHANISM == 2) || (M_USE_TRY_MECHANISM == 3) -// Use of builtin setjmp / longjmp +#if (M_USE_TRY_MECHANISM == 3) +// Use of builtin setjmp / longjmp for GCC // There are at least twice faster at worst, and reduce stack consumption // See https://gcc.gnu.org/onlinedocs/gcc/Nonlocal-Gotos.html +// CLANG doesn't support these builtins officialy (https://groups.google.com/g/llvm-dev/c/9QgfdW23K8M) #define m_try_setjmp(x) __builtin_setjmp(x) #define m_try_longjmp(x,v) __builtin_longjmp(x, v) typedef intptr_t m_try_jmp_buf[5];