mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 10:28:48 +00:00
std.debug: adjust panic message
also extern "c" instead of extern "pthread"
This commit is contained in:
parent
c9756ca0e1
commit
c24540d263
@ -13,7 +13,7 @@ pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
|
||||
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
|
||||
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;
|
||||
|
||||
pub extern "pthread" fn pthread_getthreadid_np() c_int;
|
||||
pub extern "c" fn pthread_getthreadid_np() c_int;
|
||||
|
||||
pub extern "c" fn posix_memalign(memptr: *?*c_void, alignment: usize, size: usize) c_int;
|
||||
pub extern "c" fn malloc_usable_size(?*const c_void) usize;
|
||||
|
@ -263,10 +263,10 @@ pub fn panicExtra(trace: ?*const builtin.StackTrace, first_trace_addr: ?usize, c
|
||||
|
||||
const stderr = io.getStdErr().writer();
|
||||
if (builtin.single_threaded) {
|
||||
stderr.print("main thread panicked: ", .{}) catch os.abort();
|
||||
stderr.print("panic: ", .{}) catch os.abort();
|
||||
} else {
|
||||
const current_thread_id = std.Thread.getCurrentThreadId();
|
||||
stderr.print("thread {d} panicked: ", .{current_thread_id}) catch os.abort();
|
||||
stderr.print("thread {d} panic: ", .{current_thread_id}) catch os.abort();
|
||||
}
|
||||
stderr.print(format ++ "\n", args) catch os.abort();
|
||||
if (trace) |t| {
|
||||
|
Loading…
Reference in New Issue
Block a user