aboutsummaryrefslogtreecommitdiff
path: root/lib/std/builtin.zig
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2019-12-12 01:31:32 +0000
committerAndrew Kelley <andrew@ziglang.org>2019-12-12 16:00:23 -0500
commitb37acc4d6870a090c3501d81d3f647bc30220e4b (patch)
tree5b906c0cc4c9bb358d64324b25492a4b6cabd48a /lib/std/builtin.zig
parent81f1f72197113a45e827d5c984e219a28aa28083 (diff)
downloadzig-b37acc4d6870a090c3501d81d3f647bc30220e4b.tar.gz
zig-b37acc4d6870a090c3501d81d3f647bc30220e4b.zip
allow custom OS entrypoint
Also: * Expose `std.start.callMain`. * Other fixes added to fix issues found in development.
Diffstat (limited to 'lib/std/builtin.zig')
-rw-r--r--lib/std/builtin.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 36fa46e953..5b7051eafb 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -424,6 +424,10 @@ pub const panic: PanicFn = if (@hasDecl(root, "panic")) root.panic else default_
/// therefore must be kept in sync with the compiler implementation.
pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn {
@setCold(true);
+ if (@hasDecl(root, "os") and @hasDecl(root.os, "panic")) {
+ root.os.panic(msg, error_return_trace);
+ unreachable;
+ }
switch (os) {
.freestanding => {
while (true) {