alef 0.107.9

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
    var _out_error: [*c]u8 = null;
    // The Zig and cimport'd vtables are layout-compatible but nominally distinct;
    // reinterpret the pointer because Zig 0.17 rejects a value `@bitCast`. ~keep
    const _c_vtable: *const {{ c_vtable_type }} = @ptrCast(&vtable);
    const _rc = {{ c_register }}(name, _c_vtable, user_data, @ptrCast(&_out_error));
    if (out_error) |ptr| {
        ptr.* = _out_error;
    }
    return _rc;