1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

include: Always use _setjmpex on non-i386 platforms.

This commit is contained in:
Alexandre Julliard 2024-03-08 13:25:15 +01:00
parent 5c26513278
commit 1d168222fd

View file

@ -147,30 +147,36 @@ extern "C" {
_ACRTIMP void __cdecl longjmp(jmp_buf,int);
#ifdef _WIN64
# ifdef _UCRT
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
#ifdef _UCRT
# ifdef __i386__
# define _setjmp __intrinsic_setjmp
# else
# define _setjmpex __intrinsic_setjmpex
# endif
# if defined(__GNUC__) || defined(__clang__)
_ACRTIMP 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))
# endif
#else /* _WIN64 */
# ifdef _UCRT
# define _setjmp __intrinsic_setjmp
# endif
# if defined(__GNUC__) || defined(__clang__)
_ACRTIMP int __cdecl __attribute__ ((__nothrow__,__returns_twice__)) _setjmp(jmp_buf);
# else
_ACRTIMP int __cdecl _setjmp(jmp_buf);
# endif
#endif /* _WIN64 */
#ifndef setjmp
#define setjmp _setjmp
#endif
#ifdef __i386__
# if defined(_setjmp) || !__has_builtin(_setjmp)
_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmp(jmp_buf);
# endif
# define setjmp(buf) _setjmp((buf))
#else /* __i386__ */
# if defined(_setjmpex) || !__has_builtin(_setjmpex)
_ACRTIMP int __cdecl __attribute__((__nothrow__,__returns_twice__)) _setjmpex(jmp_buf,void*);
# endif
# if __has_builtin(__builtin_sponentry)
# define setjmp(buf) _setjmpex((buf), __builtin_sponentry())
# elif __has_builtin(__builtin_frame_address)
# define setjmp(buf) _setjmpex((buf), __builtin_frame_address(0))
# else
# define setjmp(buf) _setjmpex((buf), NULL)
# endif
#endif /* __i386__ */
#ifdef __cplusplus
}
#endif