go-panic.h 1.3 KB

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