parent
72800f176e
commit
0d84d52e37
|
@ -138,15 +138,18 @@ fn getRandomBytesDevURandom(buf: []u8) !void {
|
|||
/// it raises SIGABRT followed by SIGKILL and finally lo
|
||||
pub fn abort() noreturn {
|
||||
@setCold(true);
|
||||
if (builtin.link_libc) {
|
||||
system.abort();
|
||||
}
|
||||
// MSVCRT abort() sometimes opens a popup window which is undesirable, so
|
||||
// even when linking libc on Windows we use our own abort implementation.
|
||||
// See https://github.com/ziglang/zig/issues/2071 for more details.
|
||||
if (windows.is_the_target) {
|
||||
if (builtin.mode == .Debug) {
|
||||
@breakpoint();
|
||||
}
|
||||
windows.kernel32.ExitProcess(3);
|
||||
}
|
||||
if (builtin.link_libc) {
|
||||
system.abort();
|
||||
}
|
||||
if (builtin.os == .uefi) {
|
||||
// TODO there must be a better thing to do here than loop forever
|
||||
while (true) {}
|
||||
|
|
Loading…
Reference in New Issue