callback_c_gccgo.c 451 B

123456789101112131415161718192021
  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build gccgo
  5. #include "_cgo_export.h"
  6. #include <stdint.h>
  7. #include <stdio.h>
  8. #include <stdlib.h>
  9. /* Test calling panic from C. This is what SWIG does. */
  10. extern void _cgo_panic(const char *);
  11. extern void *_cgo_allocate(size_t);
  12. void
  13. callPanic(void)
  14. {
  15. _cgo_panic("panic from C");
  16. }