blob: d29fe88b57a4396a86ead6513a453c88d26bbe30 [file] [log] [blame]
Peter Collingbourne594c10d2014-11-27 00:12:26 +00001/* go-panic.h -- declare the go panic functions.
2
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
6
7#ifndef LIBGO_GO_PANIC_H
8#define LIBGO_GO_PANIC_H
9
10#include "interface.h"
11
12struct String;
13struct __go_type_descriptor;
14struct __go_defer_stack;
15
16/* The stack of panic calls. */
17
18struct __go_panic_stack
19{
20 /* The next entry in the stack. */
21 struct __go_panic_stack *__next;
22
23 /* The value associated with this panic. */
24 struct __go_empty_interface __arg;
25
26 /* Whether this panic has been recovered. */
27 _Bool __was_recovered;
28
29 /* Whether this panic was pushed on the stack because of an
30 exception thrown in some other language. */
31 _Bool __is_foreign;
32};
33
34extern void __go_panic (struct __go_empty_interface)
35 __attribute__ ((noreturn));
36
37extern void __go_print_string (struct String);
38
39extern struct __go_empty_interface __go_recover (void);
40
41extern _Bool __go_can_recover (void *);
42
43extern void __go_makefunc_can_recover (void *retaddr);
44
45struct Location;
46extern void __go_makefunc_ffi_can_recover (struct Location *, int);
47
48extern void __go_makefunc_returning (void);
49
50extern void __go_unwind_stack (void);
51
52#endif /* !defined(LIBGO_GO_PANIC_H) */