Commit 1d168222 authored by Alexandre Julliard's avatar Alexandre Julliard

include: Always use _setjmpex on non-i386 platforms.

parent 5c265132
...@@ -147,29 +147,35 @@ extern "C" { ...@@ -147,29 +147,35 @@ extern "C" {
_ACRTIMP void __cdecl longjmp(jmp_buf,int); _ACRTIMP void __cdecl longjmp(jmp_buf,int);
#ifdef _WIN64 #ifndef __has_builtin
# ifdef _UCRT # define __has_builtin(x) 0
#endif
#ifdef _UCRT
# ifdef __i386__
# define _setjmp __intrinsic_setjmp
# else
# define _setjmpex __intrinsic_setjmpex # define _setjmpex __intrinsic_setjmpex
# endif # endif
# if defined(__GNUC__) || defined(__clang__) #endif
_ACRTIMP int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*);
# define setjmp(buf) _setjmpex(buf,__builtin_frame_address(0)) #ifdef __i386__
# define setjmpex(buf) _setjmpex(buf,__builtin_frame_address(0)) # if defined(_setjmp) || !__has_builtin(_setjmp)
_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmp(jmp_buf);
# endif # endif
#else /* _WIN64 */ # define setjmp(buf) _setjmp((buf))
# ifdef _UCRT #else /* __i386__ */
# define _setjmp __intrinsic_setjmp # if defined(_setjmpex) || !__has_builtin(_setjmpex)
_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*);
# endif # endif
# if defined(__GNUC__) || defined(__clang__) # if __has_builtin(__builtin_sponentry)
_ACRTIMP int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf); # define setjmp(buf) _setjmpex((buf), __builtin_sponentry())
# elif __has_builtin(__builtin_frame_address)
# define setjmp(buf) _setjmpex((buf), __builtin_frame_address(0))
# else # else
_ACRTIMP int __cdecl _setjmp(jmp_buf); # define setjmp(buf) _setjmpex((buf), NULL)
# endif # endif
#endif /* _WIN64 */ #endif /* __i386__ */
#ifndef setjmp
#define setjmp _setjmp
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment