Skip to content

Instantly share code, notes, and snippets.

@andrewrk
Created April 19, 2017 15:02
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 andrewrk/b9d23ac7061961d1b31d9495dad56e76 to your computer and use it in GitHub Desktop.
Save andrewrk/b9d23ac7061961d1b31d9495dad56e76 to your computer and use it in GitHub Desktop.
avoids dragging in standard library
pub fn panic(msg: []const u8) -> noreturn { @breakpoint(); while (true) {} }
comptime {
if (@sizeOf(@typeOf(foo)) == 0) unreachable;
}
// now you can have foo be any function you'd like to play with
fn foo() {
}
// build with:
// ./zig build_obj test.zig --verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment