mirror of
https://github.com/ziglang/zig.git
synced 2026-01-06 13:33:21 +00:00
std.os.abort no longer calls msvcrt abort() when linking libc
closes #2071
This commit is contained in:
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…
x
Reference in New Issue
Block a user