Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. // build with:
  2. // zig build-lib -I. --library c -dynamic test.zig
  3.  
  4. // test.zig
  5. const c = @cImport({
  6. @cInclude("aaa.h");
  7. });
  8.  
  9. pub fn main() void {
  10. c.register_func(func);
  11. }
  12.  
  13. extern fn func(opaque: [*c]c.Aaa) void { }
  14.  
  15. // -----
  16. // aaa.h
  17. struct Aaa;
  18. typedef void (func_t)(struct Aaa *opaque);
  19. void register_func(func_t func);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement