mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
update zig and rust platforms to have correct roc_panic and roc_dbg
This commit is contained in:
parent
1f14aa84a2
commit
3e66254b25
43 changed files with 475 additions and 201 deletions
|
@ -53,10 +53,16 @@ export fn roc_dealloc(c_ptr: *anyopaque, alignment: u32) callconv(.C) void {
|
|||
}
|
||||
|
||||
export fn roc_panic(msg: *RocStr, tag_id: u32) callconv(.C) void {
|
||||
_ = tag_id;
|
||||
|
||||
const stderr = std.io.getStdErr().writer();
|
||||
stderr.print("Application crashed with message\n\n {s}\n\nShutting down\n", .{msg.asSlice()}) catch unreachable;
|
||||
switch (tag_id) {
|
||||
0 => {
|
||||
stderr.print("Roc standard library crashed with message\n\n {s}\n\nShutting down\n", .{msg.asSlice()}) catch unreachable;
|
||||
},
|
||||
1 => {
|
||||
stderr.print("Application crashed with message\n\n {s}\n\nShutting down\n", .{msg.asSlice()}) catch unreachable;
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
std.process.exit(1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue