From 3d72d2600fc4fc998670d5200e92f2e79e094fb8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 6 Nov 2020 12:11:17 +0100 Subject: [PATCH] include: Fix setjmp() support with 32-bit ucrtbase. Signed-off-by: Alexandre Julliard --- include/msvcrt/setjmp.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/include/msvcrt/setjmp.h b/include/msvcrt/setjmp.h index 4b737036296..4209d6c6fd7 100644 --- a/include/msvcrt/setjmp.h +++ b/include/msvcrt/setjmp.h @@ -143,18 +143,30 @@ typedef _JBTYPE jmp_buf[_JBLEN]; extern "C" { #endif -int __cdecl _setjmp(jmp_buf); void __cdecl longjmp(jmp_buf,int); -#if defined(_WIN64) && defined(__GNUC__) +#ifdef _WIN64 # ifdef _UCRT # define _setjmpex __intrinsic_setjmpex # endif +# ifdef __GNUC__ int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*); # define setjmp(buf) _setjmpex(buf,__builtin_frame_address(0)) # define setjmpex(buf) _setjmpex(buf,__builtin_frame_address(0)) -#else -# define setjmp _setjmp +# endif +#else /* _WIN64 */ +# ifdef _UCRT +# define _setjmp __intrinsic_setjmp +# endif +# ifdef __GNUC__ +int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf); +# else +int __cdecl _setjmp(jmp_buf); +# endif +#endif /* _WIN64 */ + +#ifndef setjmp +#define setjmp _setjmp #endif #ifdef __cplusplus