We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.12.0
const libssh = @cImport({ @cInclude("libssh/libssh.h"); @cInclude("libssh/server.h"); @cInclude("libssh/callbacks.h"); }); pub fn main() !void { var callbacks = libssh.ssh_callbacks_init{}; }
Gives the following error:
/workspaces/zig-test/zig-cache/o/dc3e989fc7e6dea02d804f0d1ced5863/cimport.zig:1994:32: error: unable to translate C expr: unexpected token 'do' pub const ssh_callbacks_init = @compileError("unable to translate C expr: unexpected token 'do'"); // /usr/include/libssh/callbacks.h:420:9
Code compiles.
The text was updated successfully, but these errors were encountered:
Quick workaround:
const c = struct { pub usingnamespace @cImport({ @cInclude("libssh/libssh.h"); @cInclude("libssh/server.h"); @cInclude("libssh/callbacks.h"); }); // manually translated snippets pub const ssh = struct { pub fn callbacks_init(p: anytype) void { p.size = @sizeOf(@TypeOf(p.*)); } }; };
Sorry, something went wrong.
No branches or pull requests
Zig Version
0.12.0
Steps to Reproduce and Observed Behavior
Gives the following error:
Expected Behavior
Code compiles.
The text was updated successfully, but these errors were encountered: