diff options
Diffstat (limited to 'src/root.zig')
-rw-r--r-- | src/root.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/root.zig b/src/root.zig index a312b2a..6f6c9cb 100644 --- a/src/root.zig +++ b/src/root.zig @@ -16,12 +16,16 @@ const Result = struct { const SyscallError = error{Kernel}; -export fn _start() noreturn { +fn _start() callconv(.C) noreturn { if (!@hasDecl(root, "main")) @compileError("no main function"); root.main(); end(); } +comptime { + if (!builtin.is_test) @export(_start, .{ .name = "_start" }); +} + fn autoCast(value: anytype) usize { return switch (@typeInfo(@TypeOf(value))) { .Type => @compileError("cannot pass type to system call"), |