Skip to content

Instantly share code, notes, and snippets.

@daurnimator
Created July 21, 2019 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daurnimator/2db147d7f925ad1345d59aeb0e00341f to your computer and use it in GitHub Desktop.
Save daurnimator/2db147d7f925ad1345d59aeb0e00341f to your computer and use it in GitHub Desktop.
const builtin = @import("builtin");
const foo = @cImport({
@cDefine("EVIL", "char foo(void) {return 42;}");
@cInclude("/home/daurnimator/src/zig-playground/evil.h");
}).foo;
pub fn main() u8 {
return foo();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment