Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // build with:
- // zig build-lib -I. --library c -dynamic test.zig
- // test.zig
- const c = @cImport({
- @cInclude("aaa.h");
- });
- pub fn main() void {
- c.register_func(func);
- }
- extern fn func(opaque: [*c]c.Aaa) void { }
- // -----
- // aaa.h
- struct Aaa;
- typedef void (func_t)(struct Aaa *opaque);
- void register_func(func_t func);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement