issue8148.go 526 B

123456789101112131415161718192021222324
  1. // Copyright 2014 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. // Issue 8148. A typedef of an unnamed struct didn't work when used
  5. // with an exported Go function. No runtime test; just make sure it
  6. // compiles.
  7. package cgotest
  8. /*
  9. typedef struct { int i; } T;
  10. int get8148(void);
  11. */
  12. import "C"
  13. //export issue8148Callback
  14. func issue8148Callback(t *C.T) C.int {
  15. return t.i
  16. }
  17. func Issue8148() int {
  18. return int(C.get8148())
  19. }