std.debug: adjust panic message

also extern "c" instead of extern "pthread"
This commit is contained in:
Andrew Kelley 2021-01-01 14:56:26 -07:00
parent c9756ca0e1
commit c24540d263
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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| {