blob: 5c18723283fdd219465a72d51561247b7c2466f2 [file] [log] [blame]
Elliott Hughes13da6002025-02-03 10:42:13 -08001// Copyright (C) 2017 The Android Open Source Project
2// SPDX-License-Identifier: BSD-2-Clause
Elliott Hughes21b56eb2017-10-20 17:57:17 -07003
4#include <setjmp.h>
5
6#include "header_checks.h"
7
Elliott Hughesbf748152018-07-17 13:55:36 -07008// POSIX says it's undefined whether `setjmp` is a macro or a function,
9// but C11 says it's a macro, and the C standard always wins.
10#if !defined(setjmp)
11#error setjmp
12#endif
13
Elliott Hughes21b56eb2017-10-20 17:57:17 -070014static void setjmp_h() {
15 TYPE(jmp_buf);
16 TYPE(sigjmp_buf);
17
18 FUNCTION(_longjmp, void (*f)(jmp_buf, int));
19 FUNCTION(longjmp, void (*f)(jmp_buf, int));
20 FUNCTION(siglongjmp, void (*f)(sigjmp_buf, int));
21
22 FUNCTION(_setjmp, int (*f)(jmp_buf));
23 FUNCTION(setjmp, int (*f)(jmp_buf));
24#if defined(__GLIBC__)
25 FUNCTION(__sigsetjmp, int (*f)(sigjmp_buf, int));
26#else
27 FUNCTION(sigsetjmp, int (*f)(sigjmp_buf, int));
28#endif
29}