| author | |
| committer | |
| log | 53913acaf70f14c519b0fa0e3771d3dc641ac86b |
| tree | cc34d9eb206b47bf85447c7239a7547a59379e1a |
| parent | 5951b79af40212754071157596b8aebbe2414ffb |
| signature |
76 files changed, 153 insertions(+), 160 deletions(-)
lib/std/debug.zig+1-1| ... | @@ -2428,7 +2428,7 @@ fn resetSegfaultHandler() void { | ... | @@ -2428,7 +2428,7 @@ fn resetSegfaultHandler() void { |
| 2428 | os.sigaction(os.SIGILL, &act, null); | 2428 | os.sigaction(os.SIGILL, &act, null); |
| 2429 | } | 2429 | } |
| 2430 | 2430 | ||
| 2431 | extern fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: *const c_void) noreturn { | 2431 | fn handleSegfaultLinux(sig: i32, info: *const os.siginfo_t, ctx_ptr: *const c_void) callconv(.C) noreturn { |
| 2432 | // Reset to the default handler so that if a segfault happens in this handler it will crash | 2432 | // Reset to the default handler so that if a segfault happens in this handler it will crash |
| 2433 | // the process. Also when this handler returns, the original instruction will be repeated | 2433 | // the process. Also when this handler returns, the original instruction will be repeated |
| 2434 | // and the resulting segfault will crash the process rather than continually dump stack traces. | 2434 | // and the resulting segfault will crash the process rather than continually dump stack traces. |
lib/std/json/test.zig+6-6| ... | @@ -22,7 +22,7 @@ fn err(comptime s: []const u8) void { | ... | @@ -22,7 +22,7 @@ fn err(comptime s: []const u8) void { |
| 22 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; | 22 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; |
| 23 | var p = std.json.Parser.init(allocator, false); | 23 | var p = std.json.Parser.init(allocator, false); |
| 24 | 24 | ||
| 25 | if(p.parse(s)) |_| { | 25 | if (p.parse(s)) |_| { |
| 26 | unreachable; | 26 | unreachable; |
| 27 | } else |_| {} | 27 | } else |_| {} |
| 28 | } | 28 | } |
| ... | @@ -33,7 +33,7 @@ fn any(comptime s: []const u8) void { | ... | @@ -33,7 +33,7 @@ fn any(comptime s: []const u8) void { |
| 33 | var mem_buffer: [1024 * 20]u8 = undefined; | 33 | var mem_buffer: [1024 * 20]u8 = undefined; |
| 34 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; | 34 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; |
| 35 | var p = std.json.Parser.init(allocator, false); | 35 | var p = std.json.Parser.init(allocator, false); |
| 36 | 36 | ||
| 37 | _ = p.parse(s) catch {}; | 37 | _ = p.parse(s) catch {}; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| ... | @@ -44,7 +44,7 @@ fn anyStreamingErrNonStreaming(comptime s: []const u8) void { | ... | @@ -44,7 +44,7 @@ fn anyStreamingErrNonStreaming(comptime s: []const u8) void { |
| 44 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; | 44 | const allocator = &std.heap.FixedBufferAllocator.init(&mem_buffer).allocator; |
| 45 | var p = std.json.Parser.init(allocator, false); | 45 | var p = std.json.Parser.init(allocator, false); |
| 46 | 46 | ||
| 47 | if(p.parse(s)) |_| { | 47 | if (p.parse(s)) |_| { |
| 48 | unreachable; | 48 | unreachable; |
| 49 | } else |_| {} | 49 | } else |_| {} |
| 50 | } | 50 | } |
| ... | @@ -1742,9 +1742,9 @@ test "i_number_double_huge_neg_exp" { | ... | @@ -1742,9 +1742,9 @@ test "i_number_double_huge_neg_exp" { |
| 1742 | test "i_number_huge_exp" { | 1742 | test "i_number_huge_exp" { |
| 1743 | return error.SkipZigTest; | 1743 | return error.SkipZigTest; |
| 1744 | // FIXME Integer overflow in parseFloat | 1744 | // FIXME Integer overflow in parseFloat |
| 1745 | // any( | 1745 | // any( |
| 1746 | // \\[0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006] | 1746 | // \\[0.4e00669999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999969999999006] |
| 1747 | // ); | 1747 | // ); |
| 1748 | } | 1748 | } |
| 1749 | 1749 | ||
| 1750 | test "i_number_neg_int_huge_exp" { | 1750 | test "i_number_neg_int_huge_exp" { |
lib/std/math/sqrt.zig-1| ... | @@ -70,4 +70,3 @@ pub fn Sqrt(comptime T: type) type { | ... | @@ -70,4 +70,3 @@ pub fn Sqrt(comptime T: type) type { |
| 70 | else => T, | 70 | else => T, |
| 71 | }; | 71 | }; |
| 72 | } | 72 | } |
| 73 |
lib/std/mutex.zig+1-1| ... | @@ -17,7 +17,7 @@ const ResetEvent = std.ResetEvent; | ... | @@ -17,7 +17,7 @@ const ResetEvent = std.ResetEvent; |
| 17 | /// Example usage: | 17 | /// Example usage: |
| 18 | /// var m = Mutex.init(); | 18 | /// var m = Mutex.init(); |
| 19 | /// defer m.deinit(); | 19 | /// defer m.deinit(); |
| 20 | /// | 20 | /// |
| 21 | /// const lock = m.acquire(); | 21 | /// const lock = m.acquire(); |
| 22 | /// defer lock.release(); | 22 | /// defer lock.release(); |
| 23 | /// ... critical code | 23 | /// ... critical code |
lib/std/os/linux.zig+1-1| ... | @@ -512,7 +512,7 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { | ... | @@ -512,7 +512,7 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize { |
| 512 | return syscall2(SYS_clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); | 512 | return syscall2(SYS_clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp)); |
| 513 | } | 513 | } |
| 514 | 514 | ||
| 515 | extern fn init_vdso_clock_gettime(clk: i32, ts: *timespec) usize { | 515 | fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize { |
| 516 | const ptr = @intToPtr(?*const c_void, vdso.lookup(VDSO_CGT_VER, VDSO_CGT_SYM)); | 516 | const ptr = @intToPtr(?*const c_void, vdso.lookup(VDSO_CGT_VER, VDSO_CGT_SYM)); |
| 517 | // Note that we may not have a VDSO at all, update the stub address anyway | 517 | // Note that we may not have a VDSO at all, update the stub address anyway |
| 518 | // so that clock_gettime will fall back on the good old (and slow) syscall | 518 | // so that clock_gettime will fall back on the good old (and slow) syscall |
lib/std/os/linux/arm-eabi.zig+1-1| ... | @@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a | ... | @@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a |
| 91 | // LLVM calls this when the read-tp-hard feature is set to false. Currently, there is no way to pass | 91 | // LLVM calls this when the read-tp-hard feature is set to false. Currently, there is no way to pass |
| 92 | // that to llvm via zig, see https://github.com/ziglang/zig/issues/2883. | 92 | // that to llvm via zig, see https://github.com/ziglang/zig/issues/2883. |
| 93 | // LLVM expects libc to provide this function as __aeabi_read_tp, so it is exported if needed from special/c.zig. | 93 | // LLVM expects libc to provide this function as __aeabi_read_tp, so it is exported if needed from special/c.zig. |
| 94 | pub extern fn getThreadPointer() usize { | 94 | pub fn getThreadPointer() callconv(.C) usize { |
| 95 | return asm volatile ("mrc p15, 0, %[ret], c13, c0, 3" | 95 | return asm volatile ("mrc p15, 0, %[ret], c13, c0, 3" |
| 96 | : [ret] "=r" (-> usize) | 96 | : [ret] "=r" (-> usize) |
| 97 | ); | 97 | ); |
lib/std/os/test.zig+1-1| ... | @@ -166,7 +166,7 @@ test "sigaltstack" { | ... | @@ -166,7 +166,7 @@ test "sigaltstack" { |
| 166 | // analyzed | 166 | // analyzed |
| 167 | const dl_phdr_info = if (@hasDecl(os, "dl_phdr_info")) os.dl_phdr_info else c_void; | 167 | const dl_phdr_info = if (@hasDecl(os, "dl_phdr_info")) os.dl_phdr_info else c_void; |
| 168 | 168 | ||
| 169 | extern fn iter_fn(info: *dl_phdr_info, size: usize, data: ?*usize) i32 { | 169 | fn iter_fn(info: *dl_phdr_info, size: usize, data: ?*usize) callconv(.C) i32 { |
| 170 | if (builtin.os == .windows or builtin.os == .wasi or builtin.os == .macosx) | 170 | if (builtin.os == .windows or builtin.os == .wasi or builtin.os == .macosx) |
| 171 | return 0; | 171 | return 0; |
| 172 | 172 |
lib/std/special/c.zig+6-8| ... | @@ -40,19 +40,19 @@ comptime { | ... | @@ -40,19 +40,19 @@ comptime { |
| 40 | extern var _fltused: c_int = 1; | 40 | extern var _fltused: c_int = 1; |
| 41 | 41 | ||
| 42 | extern fn main(argc: c_int, argv: [*:null]?[*:0]u8) c_int; | 42 | extern fn main(argc: c_int, argv: [*:null]?[*:0]u8) c_int; |
| 43 | extern fn wasm_start() void { | 43 | fn wasm_start() callconv(.C) void { |
| 44 | _ = main(0, undefined); | 44 | _ = main(0, undefined); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | extern fn strcmp(s1: [*:0]const u8, s2: [*:0]const u8) c_int { | 47 | fn strcmp(s1: [*:0]const u8, s2: [*:0]const u8) callconv(.C) c_int { |
| 48 | return std.cstr.cmp(s1, s2); | 48 | return std.cstr.cmp(s1, s2); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | extern fn strlen(s: [*:0]const u8) usize { | 51 | fn strlen(s: [*:0]const u8) callconv(.C) usize { |
| 52 | return std.mem.len(u8, s); | 52 | return std.mem.len(u8, s); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | extern fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) c_int { | 55 | fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) callconv(.C) c_int { |
| 56 | if (_n == 0) return 0; | 56 | if (_n == 0) return 0; |
| 57 | var l = _l; | 57 | var l = _l; |
| 58 | var r = _r; | 58 | var r = _r; |
| ... | @@ -65,7 +65,7 @@ extern fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) c_int { | ... | @@ -65,7 +65,7 @@ extern fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) c_int { |
| 65 | return @as(c_int, l[0]) - @as(c_int, r[0]); | 65 | return @as(c_int, l[0]) - @as(c_int, r[0]); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | extern fn strerror(errnum: c_int) [*:0]const u8 { | 68 | fn strerror(errnum: c_int) callconv(.C) [*:0]const u8 { |
| 69 | return "TODO strerror implementation"; | 69 | return "TODO strerror implementation"; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| ... | @@ -188,7 +188,7 @@ comptime { | ... | @@ -188,7 +188,7 @@ comptime { |
| 188 | @export("clone", clone, builtin.GlobalLinkage.Strong); | 188 | @export("clone", clone, builtin.GlobalLinkage.Strong); |
| 189 | } | 189 | } |
| 190 | } | 190 | } |
| 191 | extern fn __stack_chk_fail() noreturn { | 191 | fn __stack_chk_fail() callconv(.C) noreturn { |
| 192 | @panic("stack smashing detected"); | 192 | @panic("stack smashing detected"); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| ... | @@ -750,7 +750,6 @@ test "sqrt special" { | ... | @@ -750,7 +750,6 @@ test "sqrt special" { |
| 750 | std.testing.expect(std.math.isNan(sqrt(std.math.nan(f64)))); | 750 | std.testing.expect(std.math.isNan(sqrt(std.math.nan(f64)))); |
| 751 | } | 751 | } |
| 752 | 752 | ||
| 753 | |||
| 754 | export fn sqrtf(x: f32) f32 { | 753 | export fn sqrtf(x: f32) f32 { |
| 755 | const tiny: f32 = 1.0e-30; | 754 | const tiny: f32 = 1.0e-30; |
| 756 | const sign: i32 = @bitCast(i32, @as(u32, 0x80000000)); | 755 | const sign: i32 = @bitCast(i32, @as(u32, 0x80000000)); |
| ... | @@ -848,4 +847,3 @@ test "sqrtf special" { | ... | @@ -848,4 +847,3 @@ test "sqrtf special" { |
| 848 | std.testing.expect(std.math.isNan(sqrtf(-1.0))); | 847 | std.testing.expect(std.math.isNan(sqrtf(-1.0))); |
| 849 | std.testing.expect(std.math.isNan(sqrtf(std.math.nan(f32)))); | 848 | std.testing.expect(std.math.isNan(sqrtf(std.math.nan(f32)))); |
| 850 | } | 849 | } |
| 851 |
lib/std/special/compiler_rt.zig+19-19| ... | @@ -309,7 +309,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn | ... | @@ -309,7 +309,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn |
| 309 | } | 309 | } |
| 310 | } | 310 | } |
| 311 | 311 | ||
| 312 | extern fn __stack_chk_fail() noreturn { | 312 | fn __stack_chk_fail() callconv(.C) noreturn { |
| 313 | @panic("stack smashing detected"); | 313 | @panic("stack smashing detected"); |
| 314 | } | 314 | } |
| 315 | 315 | ||
| ... | @@ -320,17 +320,17 @@ extern var __stack_chk_guard: usize = blk: { | ... | @@ -320,17 +320,17 @@ extern var __stack_chk_guard: usize = blk: { |
| 320 | break :blk @bitCast(usize, buf); | 320 | break :blk @bitCast(usize, buf); |
| 321 | }; | 321 | }; |
| 322 | 322 | ||
| 323 | extern fn __aeabi_unwind_cpp_pr0() void { | 323 | fn __aeabi_unwind_cpp_pr0() callconv(.C) void { |
| 324 | unreachable; | 324 | unreachable; |
| 325 | } | 325 | } |
| 326 | extern fn __aeabi_unwind_cpp_pr1() void { | 326 | fn __aeabi_unwind_cpp_pr1() callconv(.C) void { |
| 327 | unreachable; | 327 | unreachable; |
| 328 | } | 328 | } |
| 329 | extern fn __aeabi_unwind_cpp_pr2() void { | 329 | fn __aeabi_unwind_cpp_pr2() callconv(.C) void { |
| 330 | unreachable; | 330 | unreachable; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | extern fn __divmoddi4(a: i64, b: i64, rem: *i64) i64 { | 333 | fn __divmoddi4(a: i64, b: i64, rem: *i64) callconv(.C) i64 { |
| 334 | @setRuntimeSafety(is_test); | 334 | @setRuntimeSafety(is_test); |
| 335 | 335 | ||
| 336 | const d = __divdi3(a, b); | 336 | const d = __divdi3(a, b); |
| ... | @@ -338,7 +338,7 @@ extern fn __divmoddi4(a: i64, b: i64, rem: *i64) i64 { | ... | @@ -338,7 +338,7 @@ extern fn __divmoddi4(a: i64, b: i64, rem: *i64) i64 { |
| 338 | return d; | 338 | return d; |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | extern fn __divdi3(a: i64, b: i64) i64 { | 341 | fn __divdi3(a: i64, b: i64) callconv(.C) i64 { |
| 342 | @setRuntimeSafety(is_test); | 342 | @setRuntimeSafety(is_test); |
| 343 | 343 | ||
| 344 | // Set aside the sign of the quotient. | 344 | // Set aside the sign of the quotient. |
| ... | @@ -352,7 +352,7 @@ extern fn __divdi3(a: i64, b: i64) i64 { | ... | @@ -352,7 +352,7 @@ extern fn __divdi3(a: i64, b: i64) i64 { |
| 352 | return @bitCast(i64, (res ^ sign) -% sign); | 352 | return @bitCast(i64, (res ^ sign) -% sign); |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | extern fn __moddi3(a: i64, b: i64) i64 { | 355 | fn __moddi3(a: i64, b: i64) callconv(.C) i64 { |
| 356 | @setRuntimeSafety(is_test); | 356 | @setRuntimeSafety(is_test); |
| 357 | 357 | ||
| 358 | // Take absolute value of a and b via abs(x) = (x^(x >> 63)) - (x >> 63). | 358 | // Take absolute value of a and b via abs(x) = (x^(x >> 63)) - (x >> 63). |
| ... | @@ -365,12 +365,12 @@ extern fn __moddi3(a: i64, b: i64) i64 { | ... | @@ -365,12 +365,12 @@ extern fn __moddi3(a: i64, b: i64) i64 { |
| 365 | return (@bitCast(i64, r) ^ (a >> 63)) -% (a >> 63); | 365 | return (@bitCast(i64, r) ^ (a >> 63)) -% (a >> 63); |
| 366 | } | 366 | } |
| 367 | 367 | ||
| 368 | extern fn __udivdi3(a: u64, b: u64) u64 { | 368 | fn __udivdi3(a: u64, b: u64) callconv(.C) u64 { |
| 369 | @setRuntimeSafety(is_test); | 369 | @setRuntimeSafety(is_test); |
| 370 | return __udivmoddi4(a, b, null); | 370 | return __udivmoddi4(a, b, null); |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | extern fn __umoddi3(a: u64, b: u64) u64 { | 373 | fn __umoddi3(a: u64, b: u64) callconv(.C) u64 { |
| 374 | @setRuntimeSafety(is_test); | 374 | @setRuntimeSafety(is_test); |
| 375 | 375 | ||
| 376 | var r: u64 = undefined; | 376 | var r: u64 = undefined; |
| ... | @@ -378,7 +378,7 @@ extern fn __umoddi3(a: u64, b: u64) u64 { | ... | @@ -378,7 +378,7 @@ extern fn __umoddi3(a: u64, b: u64) u64 { |
| 378 | return r; | 378 | return r; |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct { | 381 | fn __aeabi_uidivmod(n: u32, d: u32) callconv(.C) extern struct { |
| 382 | q: u32, | 382 | q: u32, |
| 383 | r: u32, | 383 | r: u32, |
| 384 | } { | 384 | } { |
| ... | @@ -389,7 +389,7 @@ extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct { | ... | @@ -389,7 +389,7 @@ extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct { |
| 389 | return result; | 389 | return result; |
| 390 | } | 390 | } |
| 391 | 391 | ||
| 392 | extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct { | 392 | fn __aeabi_uldivmod(n: u64, d: u64) callconv(.C) extern struct { |
| 393 | q: u64, | 393 | q: u64, |
| 394 | r: u64, | 394 | r: u64, |
| 395 | } { | 395 | } { |
| ... | @@ -400,7 +400,7 @@ extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct { | ... | @@ -400,7 +400,7 @@ extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct { |
| 400 | return result; | 400 | return result; |
| 401 | } | 401 | } |
| 402 | 402 | ||
| 403 | extern fn __aeabi_idivmod(n: i32, d: i32) extern struct { | 403 | fn __aeabi_idivmod(n: i32, d: i32) callconv(.C) extern struct { |
| 404 | q: i32, | 404 | q: i32, |
| 405 | r: i32, | 405 | r: i32, |
| 406 | } { | 406 | } { |
| ... | @@ -411,7 +411,7 @@ extern fn __aeabi_idivmod(n: i32, d: i32) extern struct { | ... | @@ -411,7 +411,7 @@ extern fn __aeabi_idivmod(n: i32, d: i32) extern struct { |
| 411 | return result; | 411 | return result; |
| 412 | } | 412 | } |
| 413 | 413 | ||
| 414 | extern fn __aeabi_ldivmod(n: i64, d: i64) extern struct { | 414 | fn __aeabi_ldivmod(n: i64, d: i64) callconv(.C) extern struct { |
| 415 | q: i64, | 415 | q: i64, |
| 416 | r: i64, | 416 | r: i64, |
| 417 | } { | 417 | } { |
| ... | @@ -635,7 +635,7 @@ fn __aeabi_memcmp() callconv(.Naked) noreturn { | ... | @@ -635,7 +635,7 @@ fn __aeabi_memcmp() callconv(.Naked) noreturn { |
| 635 | unreachable; | 635 | unreachable; |
| 636 | } | 636 | } |
| 637 | 637 | ||
| 638 | extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 { | 638 | fn __divmodsi4(a: i32, b: i32, rem: *i32) callconv(.C) i32 { |
| 639 | @setRuntimeSafety(is_test); | 639 | @setRuntimeSafety(is_test); |
| 640 | 640 | ||
| 641 | const d = __divsi3(a, b); | 641 | const d = __divsi3(a, b); |
| ... | @@ -643,7 +643,7 @@ extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 { | ... | @@ -643,7 +643,7 @@ extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 { |
| 643 | return d; | 643 | return d; |
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | extern fn __udivmodsi4(a: u32, b: u32, rem: *u32) u32 { | 646 | fn __udivmodsi4(a: u32, b: u32, rem: *u32) callconv(.C) u32 { |
| 647 | @setRuntimeSafety(is_test); | 647 | @setRuntimeSafety(is_test); |
| 648 | 648 | ||
| 649 | const d = __udivsi3(a, b); | 649 | const d = __udivsi3(a, b); |
| ... | @@ -651,7 +651,7 @@ extern fn __udivmodsi4(a: u32, b: u32, rem: *u32) u32 { | ... | @@ -651,7 +651,7 @@ extern fn __udivmodsi4(a: u32, b: u32, rem: *u32) u32 { |
| 651 | return d; | 651 | return d; |
| 652 | } | 652 | } |
| 653 | 653 | ||
| 654 | extern fn __divsi3(n: i32, d: i32) i32 { | 654 | fn __divsi3(n: i32, d: i32) callconv(.C) i32 { |
| 655 | @setRuntimeSafety(is_test); | 655 | @setRuntimeSafety(is_test); |
| 656 | 656 | ||
| 657 | // Set aside the sign of the quotient. | 657 | // Set aside the sign of the quotient. |
| ... | @@ -665,7 +665,7 @@ extern fn __divsi3(n: i32, d: i32) i32 { | ... | @@ -665,7 +665,7 @@ extern fn __divsi3(n: i32, d: i32) i32 { |
| 665 | return @bitCast(i32, (res ^ sign) -% sign); | 665 | return @bitCast(i32, (res ^ sign) -% sign); |
| 666 | } | 666 | } |
| 667 | 667 | ||
| 668 | extern fn __udivsi3(n: u32, d: u32) u32 { | 668 | fn __udivsi3(n: u32, d: u32) callconv(.C) u32 { |
| 669 | @setRuntimeSafety(is_test); | 669 | @setRuntimeSafety(is_test); |
| 670 | 670 | ||
| 671 | const n_uword_bits: c_uint = u32.bit_count; | 671 | const n_uword_bits: c_uint = u32.bit_count; |
| ... | @@ -706,13 +706,13 @@ extern fn __udivsi3(n: u32, d: u32) u32 { | ... | @@ -706,13 +706,13 @@ extern fn __udivsi3(n: u32, d: u32) u32 { |
| 706 | return q; | 706 | return q; |
| 707 | } | 707 | } |
| 708 | 708 | ||
| 709 | extern fn __modsi3(n: i32, d: i32) i32 { | 709 | fn __modsi3(n: i32, d: i32) callconv(.C) i32 { |
| 710 | @setRuntimeSafety(is_test); | 710 | @setRuntimeSafety(is_test); |
| 711 | 711 | ||
| 712 | return n -% __divsi3(n, d) *% d; | 712 | return n -% __divsi3(n, d) *% d; |
| 713 | } | 713 | } |
| 714 | 714 | ||
| 715 | extern fn __umodsi3(n: u32, d: u32) u32 { | 715 | fn __umodsi3(n: u32, d: u32) callconv(.C) u32 { |
| 716 | @setRuntimeSafety(is_test); | 716 | @setRuntimeSafety(is_test); |
| 717 | 717 | ||
| 718 | return n -% __udivsi3(n, d) *% d; | 718 | return n -% __udivsi3(n, d) *% d; |
lib/std/special/compiler_rt/addXf3.zig+6-6| ... | @@ -6,29 +6,29 @@ const std = @import("std"); | ... | @@ -6,29 +6,29 @@ const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | const compiler_rt = @import("../compiler_rt.zig"); | 7 | const compiler_rt = @import("../compiler_rt.zig"); |
| 8 | 8 | ||
| 9 | pub extern fn __addsf3(a: f32, b: f32) f32 { | 9 | pub fn __addsf3(a: f32, b: f32) callconv(.C) f32 { |
| 10 | return addXf3(f32, a, b); | 10 | return addXf3(f32, a, b); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | pub extern fn __adddf3(a: f64, b: f64) f64 { | 13 | pub fn __adddf3(a: f64, b: f64) callconv(.C) f64 { |
| 14 | return addXf3(f64, a, b); | 14 | return addXf3(f64, a, b); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | pub extern fn __addtf3(a: f128, b: f128) f128 { | 17 | pub fn __addtf3(a: f128, b: f128) callconv(.C) f128 { |
| 18 | return addXf3(f128, a, b); | 18 | return addXf3(f128, a, b); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | pub extern fn __subsf3(a: f32, b: f32) f32 { | 21 | pub fn __subsf3(a: f32, b: f32) callconv(.C) f32 { |
| 22 | const neg_b = @bitCast(f32, @bitCast(u32, b) ^ (@as(u32, 1) << 31)); | 22 | const neg_b = @bitCast(f32, @bitCast(u32, b) ^ (@as(u32, 1) << 31)); |
| 23 | return addXf3(f32, a, neg_b); | 23 | return addXf3(f32, a, neg_b); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | pub extern fn __subdf3(a: f64, b: f64) f64 { | 26 | pub fn __subdf3(a: f64, b: f64) callconv(.C) f64 { |
| 27 | const neg_b = @bitCast(f64, @bitCast(u64, b) ^ (@as(u64, 1) << 63)); | 27 | const neg_b = @bitCast(f64, @bitCast(u64, b) ^ (@as(u64, 1) << 63)); |
| 28 | return addXf3(f64, a, neg_b); | 28 | return addXf3(f64, a, neg_b); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | pub extern fn __subtf3(a: f128, b: f128) f128 { | 31 | pub fn __subtf3(a: f128, b: f128) callconv(.C) f128 { |
| 32 | const neg_b = @bitCast(f128, @bitCast(u128, b) ^ (@as(u128, 1) << 127)); | 32 | const neg_b = @bitCast(f128, @bitCast(u128, b) ^ (@as(u128, 1) << 127)); |
| 33 | return addXf3(f128, a, neg_b); | 33 | return addXf3(f128, a, neg_b); |
| 34 | } | 34 | } |
lib/std/special/compiler_rt/ashlti3.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const compiler_rt = @import("../compiler_rt.zig"); | 2 | const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | 3 | ||
| 4 | pub extern fn __ashlti3(a: i128, b: i32) i128 { | 4 | pub fn __ashlti3(a: i128, b: i32) callconv(.C) i128 { |
| 5 | var input = twords{ .all = a }; | 5 | var input = twords{ .all = a }; |
| 6 | var result: twords = undefined; | 6 | var result: twords = undefined; |
| 7 | 7 |
lib/std/special/compiler_rt/ashrti3.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const compiler_rt = @import("../compiler_rt.zig"); | 2 | const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | 3 | ||
| 4 | pub extern fn __ashrti3(a: i128, b: i32) i128 { | 4 | pub fn __ashrti3(a: i128, b: i32) callconv(.C) i128 { |
| 5 | var input = twords{ .all = a }; | 5 | var input = twords{ .all = a }; |
| 6 | var result: twords = undefined; | 6 | var result: twords = undefined; |
| 7 | 7 |
lib/std/special/compiler_rt/aulldiv.zig+1-1| ... | @@ -1,6 +1,6 @@ | ... | @@ -1,6 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | 2 | ||
| 3 | pub extern fn _alldiv(a: i64, b: i64) callconv(.Stdcall) i64 { | 3 | pub fn _alldiv(a: i64, b: i64) callconv(.Stdcall) i64 { |
| 4 | @setRuntimeSafety(builtin.is_test); | 4 | @setRuntimeSafety(builtin.is_test); |
| 5 | const s_a = a >> (i64.bit_count - 1); | 5 | const s_a = a >> (i64.bit_count - 1); |
| 6 | const s_b = b >> (i64.bit_count - 1); | 6 | const s_b = b >> (i64.bit_count - 1); |
lib/std/special/compiler_rt/aullrem.zig+1-1| ... | @@ -1,6 +1,6 @@ | ... | @@ -1,6 +1,6 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | 2 | ||
| 3 | pub extern fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 { | 3 | pub fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 { |
| 4 | @setRuntimeSafety(builtin.is_test); | 4 | @setRuntimeSafety(builtin.is_test); |
| 5 | const s_a = a >> (i64.bit_count - 1); | 5 | const s_a = a >> (i64.bit_count - 1); |
| 6 | const s_b = b >> (i64.bit_count - 1); | 6 | const s_b = b >> (i64.bit_count - 1); |
lib/std/special/compiler_rt/comparedf2.zig+7-7| ... | @@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0); | ... | @@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0); |
| 27 | const LE_GREATER = @as(c_int, 1); | 27 | const LE_GREATER = @as(c_int, 1); |
| 28 | const LE_UNORDERED = @as(c_int, 1); | 28 | const LE_UNORDERED = @as(c_int, 1); |
| 29 | 29 | ||
| 30 | pub extern fn __ledf2(a: fp_t, b: fp_t) c_int { | 30 | pub fn __ledf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 31 | @setRuntimeSafety(is_test); | 31 | @setRuntimeSafety(is_test); |
| 32 | const aInt: srep_t = @bitCast(srep_t, a); | 32 | const aInt: srep_t = @bitCast(srep_t, a); |
| 33 | const bInt: srep_t = @bitCast(srep_t, b); | 33 | const bInt: srep_t = @bitCast(srep_t, b); |
| ... | @@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0); | ... | @@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0); |
| 70 | const GE_GREATER = @as(c_int, 1); | 70 | const GE_GREATER = @as(c_int, 1); |
| 71 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED | 71 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED |
| 72 | 72 | ||
| 73 | pub extern fn __gedf2(a: fp_t, b: fp_t) c_int { | 73 | pub fn __gedf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 74 | @setRuntimeSafety(is_test); | 74 | @setRuntimeSafety(is_test); |
| 75 | const aInt: srep_t = @bitCast(srep_t, a); | 75 | const aInt: srep_t = @bitCast(srep_t, a); |
| 76 | const bInt: srep_t = @bitCast(srep_t, b); | 76 | const bInt: srep_t = @bitCast(srep_t, b); |
| ... | @@ -94,26 +94,26 @@ pub extern fn __gedf2(a: fp_t, b: fp_t) c_int { | ... | @@ -94,26 +94,26 @@ pub extern fn __gedf2(a: fp_t, b: fp_t) c_int { |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | pub extern fn __unorddf2(a: fp_t, b: fp_t) c_int { | 97 | pub fn __unorddf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 98 | @setRuntimeSafety(is_test); | 98 | @setRuntimeSafety(is_test); |
| 99 | const aAbs: rep_t = @bitCast(rep_t, a) & absMask; | 99 | const aAbs: rep_t = @bitCast(rep_t, a) & absMask; |
| 100 | const bAbs: rep_t = @bitCast(rep_t, b) & absMask; | 100 | const bAbs: rep_t = @bitCast(rep_t, b) & absMask; |
| 101 | return @boolToInt(aAbs > infRep or bAbs > infRep); | 101 | return @boolToInt(aAbs > infRep or bAbs > infRep); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | pub extern fn __eqdf2(a: fp_t, b: fp_t) c_int { | 104 | pub fn __eqdf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 105 | return __ledf2(a, b); | 105 | return __ledf2(a, b); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | pub extern fn __ltdf2(a: fp_t, b: fp_t) c_int { | 108 | pub fn __ltdf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 109 | return __ledf2(a, b); | 109 | return __ledf2(a, b); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | pub extern fn __nedf2(a: fp_t, b: fp_t) c_int { | 112 | pub fn __nedf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 113 | return __ledf2(a, b); | 113 | return __ledf2(a, b); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | pub extern fn __gtdf2(a: fp_t, b: fp_t) c_int { | 116 | pub fn __gtdf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 117 | return __gedf2(a, b); | 117 | return __gedf2(a, b); |
| 118 | } | 118 | } |
| 119 | 119 |
lib/std/special/compiler_rt/comparesf2.zig+7-7| ... | @@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0); | ... | @@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0); |
| 27 | const LE_GREATER = @as(c_int, 1); | 27 | const LE_GREATER = @as(c_int, 1); |
| 28 | const LE_UNORDERED = @as(c_int, 1); | 28 | const LE_UNORDERED = @as(c_int, 1); |
| 29 | 29 | ||
| 30 | pub extern fn __lesf2(a: fp_t, b: fp_t) c_int { | 30 | pub fn __lesf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 31 | @setRuntimeSafety(is_test); | 31 | @setRuntimeSafety(is_test); |
| 32 | const aInt: srep_t = @bitCast(srep_t, a); | 32 | const aInt: srep_t = @bitCast(srep_t, a); |
| 33 | const bInt: srep_t = @bitCast(srep_t, b); | 33 | const bInt: srep_t = @bitCast(srep_t, b); |
| ... | @@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0); | ... | @@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0); |
| 70 | const GE_GREATER = @as(c_int, 1); | 70 | const GE_GREATER = @as(c_int, 1); |
| 71 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED | 71 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED |
| 72 | 72 | ||
| 73 | pub extern fn __gesf2(a: fp_t, b: fp_t) c_int { | 73 | pub fn __gesf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 74 | @setRuntimeSafety(is_test); | 74 | @setRuntimeSafety(is_test); |
| 75 | const aInt: srep_t = @bitCast(srep_t, a); | 75 | const aInt: srep_t = @bitCast(srep_t, a); |
| 76 | const bInt: srep_t = @bitCast(srep_t, b); | 76 | const bInt: srep_t = @bitCast(srep_t, b); |
| ... | @@ -94,26 +94,26 @@ pub extern fn __gesf2(a: fp_t, b: fp_t) c_int { | ... | @@ -94,26 +94,26 @@ pub extern fn __gesf2(a: fp_t, b: fp_t) c_int { |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | pub extern fn __unordsf2(a: fp_t, b: fp_t) c_int { | 97 | pub fn __unordsf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 98 | @setRuntimeSafety(is_test); | 98 | @setRuntimeSafety(is_test); |
| 99 | const aAbs: rep_t = @bitCast(rep_t, a) & absMask; | 99 | const aAbs: rep_t = @bitCast(rep_t, a) & absMask; |
| 100 | const bAbs: rep_t = @bitCast(rep_t, b) & absMask; | 100 | const bAbs: rep_t = @bitCast(rep_t, b) & absMask; |
| 101 | return @boolToInt(aAbs > infRep or bAbs > infRep); | 101 | return @boolToInt(aAbs > infRep or bAbs > infRep); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | pub extern fn __eqsf2(a: fp_t, b: fp_t) c_int { | 104 | pub fn __eqsf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 105 | return __lesf2(a, b); | 105 | return __lesf2(a, b); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | pub extern fn __ltsf2(a: fp_t, b: fp_t) c_int { | 108 | pub fn __ltsf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 109 | return __lesf2(a, b); | 109 | return __lesf2(a, b); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | pub extern fn __nesf2(a: fp_t, b: fp_t) c_int { | 112 | pub fn __nesf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 113 | return __lesf2(a, b); | 113 | return __lesf2(a, b); |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | pub extern fn __gtsf2(a: fp_t, b: fp_t) c_int { | 116 | pub fn __gtsf2(a: fp_t, b: fp_t) callconv(.C) c_int { |
| 117 | return __gesf2(a, b); | 117 | return __gesf2(a, b); |
| 118 | } | 118 | } |
| 119 | 119 |
lib/std/special/compiler_rt/comparetf2.zig+3-3| ... | @@ -21,7 +21,7 @@ const infRep = exponentMask; | ... | @@ -21,7 +21,7 @@ const infRep = exponentMask; |
| 21 | const builtin = @import("builtin"); | 21 | const builtin = @import("builtin"); |
| 22 | const is_test = builtin.is_test; | 22 | const is_test = builtin.is_test; |
| 23 | 23 | ||
| 24 | pub extern fn __letf2(a: f128, b: f128) c_int { | 24 | pub fn __letf2(a: f128, b: f128) callconv(.C) c_int { |
| 25 | @setRuntimeSafety(is_test); | 25 | @setRuntimeSafety(is_test); |
| 26 | 26 | ||
| 27 | const aInt = @bitCast(rep_t, a); | 27 | const aInt = @bitCast(rep_t, a); |
| ... | @@ -65,7 +65,7 @@ const GE_EQUAL = @as(c_int, 0); | ... | @@ -65,7 +65,7 @@ const GE_EQUAL = @as(c_int, 0); |
| 65 | const GE_GREATER = @as(c_int, 1); | 65 | const GE_GREATER = @as(c_int, 1); |
| 66 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED | 66 | const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED |
| 67 | 67 | ||
| 68 | pub extern fn __getf2(a: f128, b: f128) c_int { | 68 | pub fn __getf2(a: f128, b: f128) callconv(.C) c_int { |
| 69 | @setRuntimeSafety(is_test); | 69 | @setRuntimeSafety(is_test); |
| 70 | 70 | ||
| 71 | const aInt = @bitCast(srep_t, a); | 71 | const aInt = @bitCast(srep_t, a); |
| ... | @@ -90,7 +90,7 @@ pub extern fn __getf2(a: f128, b: f128) c_int { | ... | @@ -90,7 +90,7 @@ pub extern fn __getf2(a: f128, b: f128) c_int { |
| 90 | GE_GREATER; | 90 | GE_GREATER; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | pub extern fn __unordtf2(a: f128, b: f128) c_int { | 93 | pub fn __unordtf2(a: f128, b: f128) callconv(.C) c_int { |
| 94 | @setRuntimeSafety(is_test); | 94 | @setRuntimeSafety(is_test); |
| 95 | 95 | ||
| 96 | const aAbs = @bitCast(rep_t, a) & absMask; | 96 | const aAbs = @bitCast(rep_t, a) & absMask; |
lib/std/special/compiler_rt/divdf3.zig+1-1| ... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
| 5 | const std = @import("std"); | 5 | const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | 7 | ||
| 8 | pub extern fn __divdf3(a: f64, b: f64) f64 { | 8 | pub fn __divdf3(a: f64, b: f64) callconv(.C) f64 { |
| 9 | @setRuntimeSafety(builtin.is_test); | 9 | @setRuntimeSafety(builtin.is_test); |
| 10 | const Z = @IntType(false, f64.bit_count); | 10 | const Z = @IntType(false, f64.bit_count); |
| 11 | const SignedZ = @IntType(true, f64.bit_count); | 11 | const SignedZ = @IntType(true, f64.bit_count); |
lib/std/special/compiler_rt/divsf3.zig+1-1| ... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
| 5 | const std = @import("std"); | 5 | const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | 7 | ||
| 8 | pub extern fn __divsf3(a: f32, b: f32) f32 { | 8 | pub fn __divsf3(a: f32, b: f32) callconv(.C) f32 { |
| 9 | @setRuntimeSafety(builtin.is_test); | 9 | @setRuntimeSafety(builtin.is_test); |
| 10 | const Z = @IntType(false, f32.bit_count); | 10 | const Z = @IntType(false, f32.bit_count); |
| 11 | 11 |
lib/std/special/compiler_rt/divti3.zig+2-2| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const udivmod = @import("udivmod.zig").udivmod; | 1 | const udivmod = @import("udivmod.zig").udivmod; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __divti3(a: i128, b: i128) i128 { | 4 | pub fn __divti3(a: i128, b: i128) callconv(.C) i128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | 6 | ||
| 7 | const s_a = a >> (i128.bit_count - 1); | 7 | const s_a = a >> (i128.bit_count - 1); |
| ... | @@ -16,7 +16,7 @@ pub extern fn __divti3(a: i128, b: i128) i128 { | ... | @@ -16,7 +16,7 @@ pub extern fn __divti3(a: i128, b: i128) i128 { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | const v128 = @Vector(2, u64); | 18 | const v128 = @Vector(2, u64); |
| 19 | pub extern fn __divti3_windows_x86_64(a: v128, b: v128) v128 { | 19 | pub fn __divti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { |
| 20 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __divti3, .{ | 20 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __divti3, .{ |
| 21 | @bitCast(i128, a), | 21 | @bitCast(i128, a), |
| 22 | @bitCast(i128, b), | 22 | @bitCast(i128, b), |
lib/std/special/compiler_rt/extendXfYf2.zig+4-4| ... | @@ -2,19 +2,19 @@ const std = @import("std"); | ... | @@ -2,19 +2,19 @@ const std = @import("std"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | const is_test = builtin.is_test; | 3 | const is_test = builtin.is_test; |
| 4 | 4 | ||
| 5 | pub extern fn __extendsfdf2(a: f32) f64 { | 5 | pub fn __extendsfdf2(a: f32) callconv(.C) f64 { |
| 6 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f64, f32, @bitCast(u32, a) }); | 6 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f64, f32, @bitCast(u32, a) }); |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | pub extern fn __extenddftf2(a: f64) f128 { | 9 | pub fn __extenddftf2(a: f64) callconv(.C) f128 { |
| 10 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f64, @bitCast(u64, a) }); | 10 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f64, @bitCast(u64, a) }); |
| 11 | } | 11 | } |
| 12 | 12 | ||
| 13 | pub extern fn __extendsftf2(a: f32) f128 { | 13 | pub fn __extendsftf2(a: f32) callconv(.C) f128 { |
| 14 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f32, @bitCast(u32, a) }); | 14 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f32, @bitCast(u32, a) }); |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | pub extern fn __extendhfsf2(a: u16) f32 { | 17 | pub fn __extendhfsf2(a: u16) callconv(.C) f32 { |
| 18 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f32, f16, a }); | 18 | return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f32, f16, a }); |
| 19 | } | 19 | } |
| 20 | 20 |
lib/std/special/compiler_rt/fixdfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixdfdi(a: f64) i64 { | 4 | pub fn __fixdfdi(a: f64) callconv(.C) i64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f64, i64, a); | 6 | return fixint(f64, i64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixdfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixdfsi(a: f64) i32 { | 4 | pub fn __fixdfsi(a: f64) callconv(.C) i32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f64, i32, a); | 6 | return fixint(f64, i32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixdfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixdfti(a: f64) i128 { | 4 | pub fn __fixdfti(a: f64) callconv(.C) i128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f64, i128, a); | 6 | return fixint(f64, i128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixsfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixsfdi(a: f32) i64 { | 4 | pub fn __fixsfdi(a: f32) callconv(.C) i64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f32, i64, a); | 6 | return fixint(f32, i64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixsfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixsfsi(a: f32) i32 { | 4 | pub fn __fixsfsi(a: f32) callconv(.C) i32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f32, i32, a); | 6 | return fixint(f32, i32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixsfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixsfti(a: f32) i128 { | 4 | pub fn __fixsfti(a: f32) callconv(.C) i128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f32, i128, a); | 6 | return fixint(f32, i128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixtfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixtfdi(a: f128) i64 { | 4 | pub fn __fixtfdi(a: f128) callconv(.C) i64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f128, i64, a); | 6 | return fixint(f128, i64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixtfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixtfsi(a: f128) i32 { | 4 | pub fn __fixtfsi(a: f128) callconv(.C) i32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f128, i32, a); | 6 | return fixint(f128, i32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixtfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixint = @import("fixint.zig").fixint; | 1 | const fixint = @import("fixint.zig").fixint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixtfti(a: f128) i128 { | 4 | pub fn __fixtfti(a: f128) callconv(.C) i128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixint(f128, i128, a); | 6 | return fixint(f128, i128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunsdfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunsdfdi(a: f64) u64 { | 4 | pub fn __fixunsdfdi(a: f64) callconv(.C) u64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f64, u64, a); | 6 | return fixuint(f64, u64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunsdfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunsdfsi(a: f64) u32 { | 4 | pub fn __fixunsdfsi(a: f64) callconv(.C) u32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f64, u32, a); | 6 | return fixuint(f64, u32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunsdfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunsdfti(a: f64) u128 { | 4 | pub fn __fixunsdfti(a: f64) callconv(.C) u128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f64, u128, a); | 6 | return fixuint(f64, u128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunssfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunssfdi(a: f32) u64 { | 4 | pub fn __fixunssfdi(a: f32) callconv(.C) u64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f32, u64, a); | 6 | return fixuint(f32, u64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunssfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunssfsi(a: f32) u32 { | 4 | pub fn __fixunssfsi(a: f32) callconv(.C) u32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f32, u32, a); | 6 | return fixuint(f32, u32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunssfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunssfti(a: f32) u128 { | 4 | pub fn __fixunssfti(a: f32) callconv(.C) u128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f32, u128, a); | 6 | return fixuint(f32, u128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunstfdi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunstfdi(a: f128) u64 { | 4 | pub fn __fixunstfdi(a: f128) callconv(.C) u64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f128, u64, a); | 6 | return fixuint(f128, u64, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunstfsi.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunstfsi(a: f128) u32 { | 4 | pub fn __fixunstfsi(a: f128) callconv(.C) u32 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f128, u32, a); | 6 | return fixuint(f128, u32, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/fixunstfti.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const fixuint = @import("fixuint.zig").fixuint; | 1 | const fixuint = @import("fixuint.zig").fixuint; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __fixunstfti(a: f128) u128 { | 4 | pub fn __fixunstfti(a: f128) callconv(.C) u128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return fixuint(f128, u128, a); | 6 | return fixuint(f128, u128, a); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/floatdidf.zig+1-1| ... | @@ -4,7 +4,7 @@ const std = @import("std"); | ... | @@ -4,7 +4,7 @@ const std = @import("std"); |
| 4 | const twop52: f64 = 0x1.0p52; | 4 | const twop52: f64 = 0x1.0p52; |
| 5 | const twop32: f64 = 0x1.0p32; | 5 | const twop32: f64 = 0x1.0p32; |
| 6 | 6 | ||
| 7 | pub extern fn __floatdidf(a: i64) f64 { | 7 | pub fn __floatdidf(a: i64) callconv(.C) f64 { |
| 8 | @setRuntimeSafety(builtin.is_test); | 8 | @setRuntimeSafety(builtin.is_test); |
| 9 | 9 | ||
| 10 | if (a == 0) return 0; | 10 | if (a == 0) return 0; |
lib/std/special/compiler_rt/floatsiXf.zig+3-3| ... | @@ -53,17 +53,17 @@ fn floatsiXf(comptime T: type, a: i32) T { | ... | @@ -53,17 +53,17 @@ fn floatsiXf(comptime T: type, a: i32) T { |
| 53 | return @bitCast(T, result); | 53 | return @bitCast(T, result); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | pub extern fn __floatsisf(arg: i32) f32 { | 56 | pub fn __floatsisf(arg: i32) callconv(.C) f32 { |
| 57 | @setRuntimeSafety(builtin.is_test); | 57 | @setRuntimeSafety(builtin.is_test); |
| 58 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f32, arg }); | 58 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f32, arg }); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | pub extern fn __floatsidf(arg: i32) f64 { | 61 | pub fn __floatsidf(arg: i32) callconv(.C) f64 { |
| 62 | @setRuntimeSafety(builtin.is_test); | 62 | @setRuntimeSafety(builtin.is_test); |
| 63 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f64, arg }); | 63 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f64, arg }); |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | pub extern fn __floatsitf(arg: i32) f128 { | 66 | pub fn __floatsitf(arg: i32) callconv(.C) f128 { |
| 67 | @setRuntimeSafety(builtin.is_test); | 67 | @setRuntimeSafety(builtin.is_test); |
| 68 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f128, arg }); | 68 | return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f128, arg }); |
| 69 | } | 69 | } |
lib/std/special/compiler_rt/floattidf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const DBL_MANT_DIG = 53; | 6 | const DBL_MANT_DIG = 53; |
| 7 | 7 | ||
| 8 | pub extern fn __floattidf(arg: i128) f64 { | 8 | pub fn __floattidf(arg: i128) callconv(.C) f64 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/floattisf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const FLT_MANT_DIG = 24; | 6 | const FLT_MANT_DIG = 24; |
| 7 | 7 | ||
| 8 | pub extern fn __floattisf(arg: i128) f32 { | 8 | pub fn __floattisf(arg: i128) callconv(.C) f32 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/floattitf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const LDBL_MANT_DIG = 113; | 6 | const LDBL_MANT_DIG = 113; |
| 7 | 7 | ||
| 8 | pub extern fn __floattitf(arg: i128) f128 { | 8 | pub fn __floattitf(arg: i128) callconv(.C) f128 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/floatundidf.zig+1-1| ... | @@ -5,7 +5,7 @@ const twop52: f64 = 0x1.0p52; | ... | @@ -5,7 +5,7 @@ const twop52: f64 = 0x1.0p52; |
| 5 | const twop84: f64 = 0x1.0p84; | 5 | const twop84: f64 = 0x1.0p84; |
| 6 | const twop84_plus_twop52: f64 = 0x1.00000001p84; | 6 | const twop84_plus_twop52: f64 = 0x1.00000001p84; |
| 7 | 7 | ||
| 8 | pub extern fn __floatundidf(a: u64) f64 { | 8 | pub fn __floatundidf(a: u64) callconv(.C) f64 { |
| 9 | @setRuntimeSafety(builtin.is_test); | 9 | @setRuntimeSafety(builtin.is_test); |
| 10 | 10 | ||
| 11 | if (a == 0) return 0; | 11 | if (a == 0) return 0; |
lib/std/special/compiler_rt/floatunditf.zig+1-1| ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | const is_test = builtin.is_test; | 2 | const is_test = builtin.is_test; |
| 3 | const std = @import("std"); | 3 | const std = @import("std"); |
| 4 | 4 | ||
| 5 | pub extern fn __floatunditf(a: u128) f128 { | 5 | pub fn __floatunditf(a: u128) callconv(.C) f128 { |
| 6 | @setRuntimeSafety(is_test); | 6 | @setRuntimeSafety(is_test); |
| 7 | 7 | ||
| 8 | if (a == 0) { | 8 | if (a == 0) { |
lib/std/special/compiler_rt/floatunsidf.zig+1-1| ... | @@ -4,7 +4,7 @@ const maxInt = std.math.maxInt; | ... | @@ -4,7 +4,7 @@ const maxInt = std.math.maxInt; |
| 4 | 4 | ||
| 5 | const implicitBit = @as(u64, 1) << 52; | 5 | const implicitBit = @as(u64, 1) << 52; |
| 6 | 6 | ||
| 7 | pub extern fn __floatunsidf(arg: u32) f64 { | 7 | pub fn __floatunsidf(arg: u32) callconv(.C) f64 { |
| 8 | @setRuntimeSafety(builtin.is_test); | 8 | @setRuntimeSafety(builtin.is_test); |
| 9 | 9 | ||
| 10 | if (arg == 0) return 0.0; | 10 | if (arg == 0) return 0.0; |
lib/std/special/compiler_rt/floatunsitf.zig+1-1| ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | const is_test = builtin.is_test; | 2 | const is_test = builtin.is_test; |
| 3 | const std = @import("std"); | 3 | const std = @import("std"); |
| 4 | 4 | ||
| 5 | pub extern fn __floatunsitf(a: u64) f128 { | 5 | pub fn __floatunsitf(a: u64) callconv(.C) f128 { |
| 6 | @setRuntimeSafety(is_test); | 6 | @setRuntimeSafety(is_test); |
| 7 | 7 | ||
| 8 | if (a == 0) { | 8 | if (a == 0) { |
lib/std/special/compiler_rt/floatuntidf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const DBL_MANT_DIG = 53; | 6 | const DBL_MANT_DIG = 53; |
| 7 | 7 | ||
| 8 | pub extern fn __floatuntidf(arg: u128) f64 { | 8 | pub fn __floatuntidf(arg: u128) callconv(.C) f64 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/floatuntisf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const FLT_MANT_DIG = 24; | 6 | const FLT_MANT_DIG = 24; |
| 7 | 7 | ||
| 8 | pub extern fn __floatuntisf(arg: u128) f32 { | 8 | pub fn __floatuntisf(arg: u128) callconv(.C) f32 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/floatuntitf.zig+1-1| ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; | ... | @@ -5,7 +5,7 @@ const maxInt = std.math.maxInt; |
| 5 | 5 | ||
| 6 | const LDBL_MANT_DIG = 113; | 6 | const LDBL_MANT_DIG = 113; |
| 7 | 7 | ||
| 8 | pub extern fn __floatuntitf(arg: u128) f128 { | 8 | pub fn __floatuntitf(arg: u128) callconv(.C) f128 { |
| 9 | @setRuntimeSafety(is_test); | 9 | @setRuntimeSafety(is_test); |
| 10 | 10 | ||
| 11 | if (arg == 0) | 11 | if (arg == 0) |
lib/std/special/compiler_rt/lshrti3.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const compiler_rt = @import("../compiler_rt.zig"); | 2 | const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | 3 | ||
| 4 | pub extern fn __lshrti3(a: i128, b: i32) i128 { | 4 | pub fn __lshrti3(a: i128, b: i32) callconv(.C) i128 { |
| 5 | var input = twords{ .all = a }; | 5 | var input = twords{ .all = a }; |
| 6 | var result: twords = undefined; | 6 | var result: twords = undefined; |
| 7 | 7 |
lib/std/special/compiler_rt/modti3.zig+2-2| ... | @@ -6,7 +6,7 @@ const udivmod = @import("udivmod.zig").udivmod; | ... | @@ -6,7 +6,7 @@ const udivmod = @import("udivmod.zig").udivmod; |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | const compiler_rt = @import("../compiler_rt.zig"); | 7 | const compiler_rt = @import("../compiler_rt.zig"); |
| 8 | 8 | ||
| 9 | pub extern fn __modti3(a: i128, b: i128) i128 { | 9 | pub fn __modti3(a: i128, b: i128) callconv(.C) i128 { |
| 10 | @setRuntimeSafety(builtin.is_test); | 10 | @setRuntimeSafety(builtin.is_test); |
| 11 | 11 | ||
| 12 | const s_a = a >> (i128.bit_count - 1); // s = a < 0 ? -1 : 0 | 12 | const s_a = a >> (i128.bit_count - 1); // s = a < 0 ? -1 : 0 |
| ... | @@ -21,7 +21,7 @@ pub extern fn __modti3(a: i128, b: i128) i128 { | ... | @@ -21,7 +21,7 @@ pub extern fn __modti3(a: i128, b: i128) i128 { |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | const v128 = @Vector(2, u64); | 23 | const v128 = @Vector(2, u64); |
| 24 | pub extern fn __modti3_windows_x86_64(a: v128, b: v128) v128 { | 24 | pub fn __modti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { |
| 25 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __modti3, .{ | 25 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __modti3, .{ |
| 26 | @bitCast(i128, a), | 26 | @bitCast(i128, a), |
| 27 | @bitCast(i128, b), | 27 | @bitCast(i128, b), |
lib/std/special/compiler_rt/mulXf3.zig+3-3| ... | @@ -6,13 +6,13 @@ const std = @import("std"); | ... | @@ -6,13 +6,13 @@ const std = @import("std"); |
| 6 | const builtin = @import("builtin"); | 6 | const builtin = @import("builtin"); |
| 7 | const compiler_rt = @import("../compiler_rt.zig"); | 7 | const compiler_rt = @import("../compiler_rt.zig"); |
| 8 | 8 | ||
| 9 | pub extern fn __multf3(a: f128, b: f128) f128 { | 9 | pub fn __multf3(a: f128, b: f128) callconv(.C) f128 { |
| 10 | return mulXf3(f128, a, b); | 10 | return mulXf3(f128, a, b); |
| 11 | } | 11 | } |
| 12 | pub extern fn __muldf3(a: f64, b: f64) f64 { | 12 | pub fn __muldf3(a: f64, b: f64) callconv(.C) f64 { |
| 13 | return mulXf3(f64, a, b); | 13 | return mulXf3(f64, a, b); |
| 14 | } | 14 | } |
| 15 | pub extern fn __mulsf3(a: f32, b: f32) f32 { | 15 | pub fn __mulsf3(a: f32, b: f32) callconv(.C) f32 { |
| 16 | return mulXf3(f32, a, b); | 16 | return mulXf3(f32, a, b); |
| 17 | } | 17 | } |
| 18 | 18 |
lib/std/special/compiler_rt/muldi3.zig+1-1| ... | @@ -39,7 +39,7 @@ fn __muldsi3(a: u32, b: u32) i64 { | ... | @@ -39,7 +39,7 @@ fn __muldsi3(a: u32, b: u32) i64 { |
| 39 | return r.all; | 39 | return r.all; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | pub extern fn __muldi3(a: i64, b: i64) i64 { | 42 | pub fn __muldi3(a: i64, b: i64) callconv(.C) i64 { |
| 43 | @setRuntimeSafety(builtin.is_test); | 43 | @setRuntimeSafety(builtin.is_test); |
| 44 | 44 | ||
| 45 | const x = dwords{ .all = a }; | 45 | const x = dwords{ .all = a }; |
lib/std/special/compiler_rt/mulodi4.zig+1-1| ... | @@ -3,7 +3,7 @@ const compiler_rt = @import("../compiler_rt.zig"); | ... | @@ -3,7 +3,7 @@ const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | const maxInt = std.math.maxInt; | 3 | const maxInt = std.math.maxInt; |
| 4 | const minInt = std.math.minInt; | 4 | const minInt = std.math.minInt; |
| 5 | 5 | ||
| 6 | pub extern fn __mulodi4(a: i64, b: i64, overflow: *c_int) i64 { | 6 | pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 { |
| 7 | @setRuntimeSafety(builtin.is_test); | 7 | @setRuntimeSafety(builtin.is_test); |
| 8 | 8 | ||
| 9 | const min = @bitCast(i64, @as(u64, 1 << (i64.bit_count - 1))); | 9 | const min = @bitCast(i64, @as(u64, 1 << (i64.bit_count - 1))); |
lib/std/special/compiler_rt/muloti4.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const builtin = @import("builtin"); | 1 | const builtin = @import("builtin"); |
| 2 | const compiler_rt = @import("../compiler_rt.zig"); | 2 | const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | 3 | ||
| 4 | pub extern fn __muloti4(a: i128, b: i128, overflow: *c_int) i128 { | 4 | pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | 6 | ||
| 7 | const min = @bitCast(i128, @as(u128, 1 << (i128.bit_count - 1))); | 7 | const min = @bitCast(i128, @as(u128, 1 << (i128.bit_count - 1))); |
lib/std/special/compiler_rt/multi3.zig+2-2| ... | @@ -5,7 +5,7 @@ const compiler_rt = @import("../compiler_rt.zig"); | ... | @@ -5,7 +5,7 @@ const compiler_rt = @import("../compiler_rt.zig"); |
| 5 | // ae684fad6d34858c014c94da69c15e7774a633c3 | 5 | // ae684fad6d34858c014c94da69c15e7774a633c3 |
| 6 | // 2018-08-13 | 6 | // 2018-08-13 |
| 7 | 7 | ||
| 8 | pub extern fn __multi3(a: i128, b: i128) i128 { | 8 | pub fn __multi3(a: i128, b: i128) callconv(.C) i128 { |
| 9 | @setRuntimeSafety(builtin.is_test); | 9 | @setRuntimeSafety(builtin.is_test); |
| 10 | const x = twords{ .all = a }; | 10 | const x = twords{ .all = a }; |
| 11 | const y = twords{ .all = b }; | 11 | const y = twords{ .all = b }; |
| ... | @@ -15,7 +15,7 @@ pub extern fn __multi3(a: i128, b: i128) i128 { | ... | @@ -15,7 +15,7 @@ pub extern fn __multi3(a: i128, b: i128) i128 { |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | const v128 = @Vector(2, u64); | 17 | const v128 = @Vector(2, u64); |
| 18 | pub extern fn __multi3_windows_x86_64(a: v128, b: v128) v128 { | 18 | pub fn __multi3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { |
| 19 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __multi3, .{ | 19 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __multi3, .{ |
| 20 | @bitCast(i128, a), | 20 | @bitCast(i128, a), |
| 21 | @bitCast(i128, b), | 21 | @bitCast(i128, b), |
lib/std/special/compiler_rt/negXf2.zig+2-2| ... | @@ -1,10 +1,10 @@ | ... | @@ -1,10 +1,10 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | 2 | ||
| 3 | pub extern fn __negsf2(a: f32) f32 { | 3 | pub fn __negsf2(a: f32) callconv(.C) f32 { |
| 4 | return negXf2(f32, a); | 4 | return negXf2(f32, a); |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | pub extern fn __negdf2(a: f64) f64 { | 7 | pub fn __negdf2(a: f64) callconv(.C) f64 { |
| 8 | return negXf2(f64, a); | 8 | return negXf2(f64, a); |
| 9 | } | 9 | } |
| 10 | 10 |
lib/std/special/compiler_rt/popcountdi2.zig+1-1| ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); | ... | @@ -2,7 +2,7 @@ const builtin = @import("builtin"); |
| 2 | const compiler_rt = @import("../compiler_rt.zig"); | 2 | const compiler_rt = @import("../compiler_rt.zig"); |
| 3 | 3 | ||
| 4 | // ported from llvm compiler-rt 8.0.0rc3 95e1c294cb0415a377a7b1d6c7c7d4f89e1c04e4 | 4 | // ported from llvm compiler-rt 8.0.0rc3 95e1c294cb0415a377a7b1d6c7c7d4f89e1c04e4 |
| 5 | pub extern fn __popcountdi2(a: i64) i32 { | 5 | pub fn __popcountdi2(a: i64) callconv(.C) i32 { |
| 6 | var x2 = @bitCast(u64, a); | 6 | var x2 = @bitCast(u64, a); |
| 7 | x2 = x2 - ((x2 >> 1) & 0x5555555555555555); | 7 | x2 = x2 - ((x2 >> 1) & 0x5555555555555555); |
| 8 | // Every 2 bits holds the sum of every pair of bits (32) | 8 | // Every 2 bits holds the sum of every pair of bits (32) |
lib/std/special/compiler_rt/truncXfYf2.zig+5-5| ... | @@ -1,22 +1,22 @@ | ... | @@ -1,22 +1,22 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | 2 | ||
| 3 | pub extern fn __truncsfhf2(a: f32) u16 { | 3 | pub fn __truncsfhf2(a: f32) callconv(.C) u16 { |
| 4 | return @bitCast(u16, truncXfYf2(f16, f32, a)); | 4 | return @bitCast(u16, truncXfYf2(f16, f32, a)); |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | pub extern fn __truncdfhf2(a: f64) u16 { | 7 | pub fn __truncdfhf2(a: f64) callconv(.C) u16 { |
| 8 | return @bitCast(u16, truncXfYf2(f16, f64, a)); | 8 | return @bitCast(u16, truncXfYf2(f16, f64, a)); |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | pub extern fn __trunctfsf2(a: f128) f32 { | 11 | pub fn __trunctfsf2(a: f128) callconv(.C) f32 { |
| 12 | return truncXfYf2(f32, f128, a); | 12 | return truncXfYf2(f32, f128, a); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | pub extern fn __trunctfdf2(a: f128) f64 { | 15 | pub fn __trunctfdf2(a: f128) callconv(.C) f64 { |
| 16 | return truncXfYf2(f64, f128, a); | 16 | return truncXfYf2(f64, f128, a); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | pub extern fn __truncdfsf2(a: f64) f32 { | 19 | pub fn __truncdfsf2(a: f64) callconv(.C) f32 { |
| 20 | return truncXfYf2(f32, f64, a); | 20 | return truncXfYf2(f32, f64, a); |
| 21 | } | 21 | } |
| 22 | 22 |
lib/std/special/compiler_rt/udivmoddi4.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const udivmod = @import("udivmod.zig").udivmod; | 1 | const udivmod = @import("udivmod.zig").udivmod; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?*u64) u64 { | 4 | pub fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?*u64) callconv(.C) u64 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return udivmod(u64, a, b, maybe_rem); | 6 | return udivmod(u64, a, b, maybe_rem); |
| 7 | } | 7 | } |
lib/std/special/compiler_rt/udivmodti4.zig+2-2| ... | @@ -2,13 +2,13 @@ const udivmod = @import("udivmod.zig").udivmod; | ... | @@ -2,13 +2,13 @@ const udivmod = @import("udivmod.zig").udivmod; |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | const compiler_rt = @import("../compiler_rt.zig"); | 3 | const compiler_rt = @import("../compiler_rt.zig"); |
| 4 | 4 | ||
| 5 | pub extern fn __udivmodti4(a: u128, b: u128, maybe_rem: ?*u128) u128 { | 5 | pub fn __udivmodti4(a: u128, b: u128, maybe_rem: ?*u128) callconv(.C) u128 { |
| 6 | @setRuntimeSafety(builtin.is_test); | 6 | @setRuntimeSafety(builtin.is_test); |
| 7 | return udivmod(u128, a, b, maybe_rem); | 7 | return udivmod(u128, a, b, maybe_rem); |
| 8 | } | 8 | } |
| 9 | 9 | ||
| 10 | const v128 = @Vector(2, u64); | 10 | const v128 = @Vector(2, u64); |
| 11 | pub extern fn __udivmodti4_windows_x86_64(a: v128, b: v128, maybe_rem: ?*u128) v128 { | 11 | pub fn __udivmodti4_windows_x86_64(a: v128, b: v128, maybe_rem: ?*u128) callconv(.C) v128 { |
| 12 | @setRuntimeSafety(builtin.is_test); | 12 | @setRuntimeSafety(builtin.is_test); |
| 13 | return @bitCast(v128, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), maybe_rem)); | 13 | return @bitCast(v128, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), maybe_rem)); |
| 14 | } | 14 | } |
lib/std/special/compiler_rt/udivti3.zig+2-2| ... | @@ -1,13 +1,13 @@ | ... | @@ -1,13 +1,13 @@ |
| 1 | const udivmodti4 = @import("udivmodti4.zig"); | 1 | const udivmodti4 = @import("udivmodti4.zig"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | 3 | ||
| 4 | pub extern fn __udivti3(a: u128, b: u128) u128 { | 4 | pub fn __udivti3(a: u128, b: u128) callconv(.C) u128 { |
| 5 | @setRuntimeSafety(builtin.is_test); | 5 | @setRuntimeSafety(builtin.is_test); |
| 6 | return udivmodti4.__udivmodti4(a, b, null); | 6 | return udivmodti4.__udivmodti4(a, b, null); |
| 7 | } | 7 | } |
| 8 | 8 | ||
| 9 | const v128 = @Vector(2, u64); | 9 | const v128 = @Vector(2, u64); |
| 10 | pub extern fn __udivti3_windows_x86_64(a: v128, b: v128) v128 { | 10 | pub fn __udivti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { |
| 11 | @setRuntimeSafety(builtin.is_test); | 11 | @setRuntimeSafety(builtin.is_test); |
| 12 | return udivmodti4.__udivmodti4_windows_x86_64(a, b, null); | 12 | return udivmodti4.__udivmodti4_windows_x86_64(a, b, null); |
| 13 | } | 13 | } |
lib/std/special/compiler_rt/umodti3.zig+2-2| ... | @@ -2,7 +2,7 @@ const udivmodti4 = @import("udivmodti4.zig"); | ... | @@ -2,7 +2,7 @@ const udivmodti4 = @import("udivmodti4.zig"); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | const compiler_rt = @import("../compiler_rt.zig"); | 3 | const compiler_rt = @import("../compiler_rt.zig"); |
| 4 | 4 | ||
| 5 | pub extern fn __umodti3(a: u128, b: u128) u128 { | 5 | pub fn __umodti3(a: u128, b: u128) callconv(.C) u128 { |
| 6 | @setRuntimeSafety(builtin.is_test); | 6 | @setRuntimeSafety(builtin.is_test); |
| 7 | var r: u128 = undefined; | 7 | var r: u128 = undefined; |
| 8 | _ = udivmodti4.__udivmodti4(a, b, &r); | 8 | _ = udivmodti4.__udivmodti4(a, b, &r); |
| ... | @@ -10,7 +10,7 @@ pub extern fn __umodti3(a: u128, b: u128) u128 { | ... | @@ -10,7 +10,7 @@ pub extern fn __umodti3(a: u128, b: u128) u128 { |
| 10 | } | 10 | } |
| 11 | 11 | ||
| 12 | const v128 = @Vector(2, u64); | 12 | const v128 = @Vector(2, u64); |
| 13 | pub extern fn __umodti3_windows_x86_64(a: v128, b: v128) v128 { | 13 | pub fn __umodti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 { |
| 14 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __umodti3, .{ | 14 | return @bitCast(v128, @call(.{ .modifier = .always_inline }, __umodti3, .{ |
| 15 | @bitCast(u128, a), | 15 | @bitCast(u128, a), |
| 16 | @bitCast(u128, b), | 16 | @bitCast(u128, b), |
lib/std/start.zig+4-8| ... | @@ -43,11 +43,7 @@ comptime { | ... | @@ -43,11 +43,7 @@ comptime { |
| 43 | } | 43 | } |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | fn _DllMainCRTStartup( | 46 | fn _DllMainCRTStartup(hinstDLL: std.os.windows.HINSTANCE, fdwReason: std.os.windows.DWORD, lpReserved: std.os.windows.LPVOID) callconv(.Stdcall) std.os.windows.BOOL { |
| 47 | hinstDLL: std.os.windows.HINSTANCE, | ||
| 48 | fdwReason: std.os.windows.DWORD, | ||
| 49 | lpReserved: std.os.windows.LPVOID, | ||
| 50 | ) callconv(.Stdcall) std.os.windows.BOOL { | ||
| 51 | if (@hasDecl(root, "DllMain")) { | 47 | if (@hasDecl(root, "DllMain")) { |
| 52 | return root.DllMain(hinstDLL, fdwReason, lpReserved); | 48 | return root.DllMain(hinstDLL, fdwReason, lpReserved); |
| 53 | } | 49 | } |
| ... | @@ -55,13 +51,13 @@ fn _DllMainCRTStartup( | ... | @@ -55,13 +51,13 @@ fn _DllMainCRTStartup( |
| 55 | return std.os.windows.TRUE; | 51 | return std.os.windows.TRUE; |
| 56 | } | 52 | } |
| 57 | 53 | ||
| 58 | extern fn wasm_freestanding_start() void { | 54 | fn wasm_freestanding_start() callconv(.C) void { |
| 59 | // This is marked inline because for some reason LLVM in release mode fails to inline it, | 55 | // This is marked inline because for some reason LLVM in release mode fails to inline it, |
| 60 | // and we want fewer call frames in stack traces. | 56 | // and we want fewer call frames in stack traces. |
| 61 | _ = @call(.{ .modifier = .always_inline }, callMain, .{}); | 57 | _ = @call(.{ .modifier = .always_inline }, callMain, .{}); |
| 62 | } | 58 | } |
| 63 | 59 | ||
| 64 | extern fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) usize { | 60 | fn EfiMain(handle: uefi.Handle, system_table: *uefi.tables.SystemTable) callconv(.C) usize { |
| 65 | const bad_efi_main_ret = "expected return type of main to be 'void', 'noreturn', or 'usize'"; | 61 | const bad_efi_main_ret = "expected return type of main to be 'void', 'noreturn', or 'usize'"; |
| 66 | uefi.handle = handle; | 62 | uefi.handle = handle; |
| 67 | uefi.system_table = system_table; | 63 | uefi.system_table = system_table; |
| ... | @@ -198,7 +194,7 @@ fn callMainWithArgs(argc: usize, argv: [*][*:0]u8, envp: [][*:0]u8) u8 { | ... | @@ -198,7 +194,7 @@ fn callMainWithArgs(argc: usize, argv: [*][*:0]u8, envp: [][*:0]u8) u8 { |
| 198 | return initEventLoopAndCallMain(); | 194 | return initEventLoopAndCallMain(); |
| 199 | } | 195 | } |
| 200 | 196 | ||
| 201 | extern fn main(c_argc: i32, c_argv: [*][*:0]u8, c_envp: [*:null]?[*:0]u8) i32 { | 197 | fn main(c_argc: i32, c_argv: [*][*:0]u8, c_envp: [*:null]?[*:0]u8) callconv(.C) i32 { |
| 202 | var env_count: usize = 0; | 198 | var env_count: usize = 0; |
| 203 | while (c_envp[env_count] != null) : (env_count += 1) {} | 199 | while (c_envp[env_count] != null) : (env_count += 1) {} |
| 204 | const envp = @ptrCast([*][*:0]u8, c_envp)[0..env_count]; | 200 | const envp = @ptrCast([*][*:0]u8, c_envp)[0..env_count]; |
lib/std/thread.zig+3-3| ... | @@ -156,7 +156,7 @@ pub const Thread = struct { | ... | @@ -156,7 +156,7 @@ pub const Thread = struct { |
| 156 | thread: Thread, | 156 | thread: Thread, |
| 157 | inner: Context, | 157 | inner: Context, |
| 158 | }; | 158 | }; |
| 159 | extern fn threadMain(raw_arg: windows.LPVOID) windows.DWORD { | 159 | fn threadMain(raw_arg: windows.LPVOID) callconv(.C) windows.DWORD { |
| 160 | const arg = if (@sizeOf(Context) == 0) {} else @ptrCast(*Context, @alignCast(@alignOf(Context), raw_arg)).*; | 160 | const arg = if (@sizeOf(Context) == 0) {} else @ptrCast(*Context, @alignCast(@alignOf(Context), raw_arg)).*; |
| 161 | switch (@typeId(@TypeOf(startFn).ReturnType)) { | 161 | switch (@typeId(@TypeOf(startFn).ReturnType)) { |
| 162 | .Int => { | 162 | .Int => { |
| ... | @@ -198,7 +198,7 @@ pub const Thread = struct { | ... | @@ -198,7 +198,7 @@ pub const Thread = struct { |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | const MainFuncs = struct { | 200 | const MainFuncs = struct { |
| 201 | extern fn linuxThreadMain(ctx_addr: usize) u8 { | 201 | fn linuxThreadMain(ctx_addr: usize) callconv(.C) u8 { |
| 202 | const arg = if (@sizeOf(Context) == 0) {} else @intToPtr(*const Context, ctx_addr).*; | 202 | const arg = if (@sizeOf(Context) == 0) {} else @intToPtr(*const Context, ctx_addr).*; |
| 203 | 203 | ||
| 204 | switch (@typeId(@TypeOf(startFn).ReturnType)) { | 204 | switch (@typeId(@TypeOf(startFn).ReturnType)) { |
| ... | @@ -212,7 +212,7 @@ pub const Thread = struct { | ... | @@ -212,7 +212,7 @@ pub const Thread = struct { |
| 212 | else => @compileError("expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'"), | 212 | else => @compileError("expected return type of startFn to be 'u8', 'noreturn', 'void', or '!void'"), |
| 213 | } | 213 | } |
| 214 | } | 214 | } |
| 215 | extern fn posixThreadMain(ctx: ?*c_void) ?*c_void { | 215 | fn posixThreadMain(ctx: ?*c_void) callconv(.C) ?*c_void { |
| 216 | if (@sizeOf(Context) == 0) { | 216 | if (@sizeOf(Context) == 0) { |
| 217 | _ = startFn({}); | 217 | _ = startFn({}); |
| 218 | return null; | 218 | return null; |
lib/std/unicode/throughput_test.zig+1-1| ... | @@ -22,7 +22,7 @@ pub fn main() !void { | ... | @@ -22,7 +22,7 @@ pub fn main() !void { |
| 22 | const elapsed_ns_orig = timer.lap(); | 22 | const elapsed_ns_orig = timer.lap(); |
| 23 | @fence(.SeqCst); | 23 | @fence(.SeqCst); |
| 24 | 24 | ||
| 25 | var buffer2: [32767] u16 align(4096) = undefined; | 25 | var buffer2: [32767]u16 align(4096) = undefined; |
| 26 | _ = try std.unicode.utf8ToUtf16Le_better(&buffer2, args[1]); | 26 | _ = try std.unicode.utf8ToUtf16Le_better(&buffer2, args[1]); |
| 27 | 27 | ||
| 28 | @fence(.SeqCst); | 28 | @fence(.SeqCst); |
test/compile_errors.zig+3-3| ... | @@ -2972,7 +2972,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -2972,7 +2972,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 2972 | \\ foo(bar); | 2972 | \\ foo(bar); |
| 2973 | \\} | 2973 | \\} |
| 2974 | \\ | 2974 | \\ |
| 2975 | \\extern fn bar(x: *void) void { } | 2975 | \\fn bar(x: *void) callconv(.C) void { } |
| 2976 | \\export fn entry2() void { | 2976 | \\export fn entry2() void { |
| 2977 | \\ bar(&{}); | 2977 | \\ bar(&{}); |
| 2978 | \\} | 2978 | \\} |
| ... | @@ -3871,7 +3871,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -3871,7 +3871,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 3871 | \\ | 3871 | \\ |
| 3872 | \\export fn entry() usize { return @sizeOf(@TypeOf(fns)); } | 3872 | \\export fn entry() usize { return @sizeOf(@TypeOf(fns)); } |
| 3873 | , &[_][]const u8{ | 3873 | , &[_][]const u8{ |
| 3874 | "tmp.zig:1:37: error: expected type 'fn(i32) i32', found 'extern fn(i32) i32'", | 3874 | "tmp.zig:1:37: error: expected type 'fn(i32) i32', found 'fn(i32) callconv(.C) i32'", |
| 3875 | }); | 3875 | }); |
| 3876 | 3876 | ||
| 3877 | cases.add("colliding invalid top level functions", | 3877 | cases.add("colliding invalid top level functions", |
| ... | @@ -5618,7 +5618,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { | ... | @@ -5618,7 +5618,7 @@ pub fn addCases(cases: *tests.CompileErrorContext) void { |
| 5618 | }); | 5618 | }); |
| 5619 | 5619 | ||
| 5620 | cases.add("wrong types given to @export", | 5620 | cases.add("wrong types given to @export", |
| 5621 | \\extern fn entry() void { } | 5621 | \\fn entry() callconv(.C) void { } |
| 5622 | \\comptime { | 5622 | \\comptime { |
| 5623 | \\ @export("entry", entry, @as(u32, 1234)); | 5623 | \\ @export("entry", entry, @as(u32, 1234)); |
| 5624 | \\} | 5624 | \\} |
test/stage1/behavior/align.zig+3-3| ... | @@ -221,14 +221,14 @@ test "alignment of structs" { | ... | @@ -221,14 +221,14 @@ test "alignment of structs" { |
| 221 | }) == @alignOf(usize)); | 221 | }) == @alignOf(usize)); |
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | test "alignment of extern() void" { | 224 | test "alignment of function with c calling convention" { |
| 225 | var runtime_nothing = nothing; | 225 | var runtime_nothing = nothing; |
| 226 | const casted1 = @ptrCast(*const u8, runtime_nothing); | 226 | const casted1 = @ptrCast(*const u8, runtime_nothing); |
| 227 | const casted2 = @ptrCast(extern fn () void, casted1); | 227 | const casted2 = @ptrCast(fn () callconv(.C) void, casted1); |
| 228 | casted2(); | 228 | casted2(); |
| 229 | } | 229 | } |
| 230 | 230 | ||
| 231 | extern fn nothing() void {} | 231 | fn nothing() callconv(.C) void {} |
| 232 | 232 | ||
| 233 | test "return error union with 128-bit integer" { | 233 | test "return error union with 128-bit integer" { |
| 234 | expect(3 == try give()); | 234 | expect(3 == try give()); |
test/stage1/behavior/bugs/1310.zig+2-2| ... | @@ -3,7 +3,7 @@ const expect = std.testing.expect; | ... | @@ -3,7 +3,7 @@ const expect = std.testing.expect; |
| 3 | 3 | ||
| 4 | pub const VM = ?[*]const struct_InvocationTable_; | 4 | pub const VM = ?[*]const struct_InvocationTable_; |
| 5 | pub const struct_InvocationTable_ = extern struct { | 5 | pub const struct_InvocationTable_ = extern struct { |
| 6 | GetVM: ?extern fn (?[*]VM) c_int, | 6 | GetVM: ?fn (?[*]VM) callconv(.C) c_int, |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | pub const struct_VM_ = extern struct { | 9 | pub const struct_VM_ = extern struct { |
| ... | @@ -15,7 +15,7 @@ pub const struct_VM_ = extern struct { | ... | @@ -15,7 +15,7 @@ pub const struct_VM_ = extern struct { |
| 15 | pub const InvocationTable_ = struct_InvocationTable_; | 15 | pub const InvocationTable_ = struct_InvocationTable_; |
| 16 | pub const VM_ = struct_VM_; | 16 | pub const VM_ = struct_VM_; |
| 17 | 17 | ||
| 18 | extern fn agent_callback(_vm: [*]VM, options: [*]u8) i32 { | 18 | fn agent_callback(_vm: [*]VM, options: [*]u8) callconv(.C) i32 { |
| 19 | return 11; | 19 | return 11; |
| 20 | } | 20 | } |
| 21 | 21 |
test/stage1/behavior/cast.zig+2-2| ... | @@ -477,7 +477,7 @@ test "compile time int to ptr of function" { | ... | @@ -477,7 +477,7 @@ test "compile time int to ptr of function" { |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | pub const FUNCTION_CONSTANT = @intToPtr(PFN_void, maxInt(usize)); | 479 | pub const FUNCTION_CONSTANT = @intToPtr(PFN_void, maxInt(usize)); |
| 480 | pub const PFN_void = extern fn (*c_void) void; | 480 | pub const PFN_void = fn (*c_void) callconv(.C) void; |
| 481 | 481 | ||
| 482 | fn foobar(func: PFN_void) void { | 482 | fn foobar(func: PFN_void) void { |
| 483 | std.testing.expect(@ptrToInt(func) == maxInt(usize)); | 483 | std.testing.expect(@ptrToInt(func) == maxInt(usize)); |
| ... | @@ -587,7 +587,7 @@ test "peer cast *[0]T to []const T" { | ... | @@ -587,7 +587,7 @@ test "peer cast *[0]T to []const T" { |
| 587 | 587 | ||
| 588 | var global_array: [4]u8 = undefined; | 588 | var global_array: [4]u8 = undefined; |
| 589 | test "cast from array reference to fn" { | 589 | test "cast from array reference to fn" { |
| 590 | const f = @ptrCast(extern fn () void, &global_array); | 590 | const f = @ptrCast(fn () callconv(.C) void, &global_array); |
| 591 | expect(@ptrToInt(f) == @ptrToInt(&global_array)); | 591 | expect(@ptrToInt(f) == @ptrToInt(&global_array)); |
| 592 | } | 592 | } |
| 593 | 593 |
test/stage1/behavior/misc.zig+1-1| ... | @@ -19,7 +19,7 @@ comptime { | ... | @@ -19,7 +19,7 @@ comptime { |
| 19 | @export("disabledExternFn", disabledExternFn, builtin.GlobalLinkage.Internal); | 19 | @export("disabledExternFn", disabledExternFn, builtin.GlobalLinkage.Internal); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | extern fn disabledExternFn() void {} | 22 | fn disabledExternFn() callconv(.C) void {} |
| 23 | 23 | ||
| 24 | test "call disabled extern fn" { | 24 | test "call disabled extern fn" { |
| 25 | disabledExternFn(); | 25 | disabledExternFn(); |
test/stage1/behavior/struct.zig+2-2| ... | @@ -580,7 +580,7 @@ test "default struct initialization fields" { | ... | @@ -580,7 +580,7 @@ test "default struct initialization fields" { |
| 580 | expectEqual(1239, x.a + x.b); | 580 | expectEqual(1239, x.a + x.b); |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | test "extern fn returns struct by value" { | 583 | test "fn with C calling convention returns struct by value" { |
| 584 | const S = struct { | 584 | const S = struct { |
| 585 | fn entry() void { | 585 | fn entry() void { |
| 586 | var x = makeBar(10); | 586 | var x = makeBar(10); |
| ... | @@ -591,7 +591,7 @@ test "extern fn returns struct by value" { | ... | @@ -591,7 +591,7 @@ test "extern fn returns struct by value" { |
| 591 | handle: i32, | 591 | handle: i32, |
| 592 | }; | 592 | }; |
| 593 | 593 | ||
| 594 | extern fn makeBar(t: i32) ExternBar { | 594 | fn makeBar(t: i32) callconv(.C) ExternBar { |
| 595 | return ExternBar{ | 595 | return ExternBar{ |
| 596 | .handle = t, | 596 | .handle = t, |
| 597 | }; | 597 | }; |
test/standalone/load_dynamic_library/main.zig+1-1| ... | @@ -9,7 +9,7 @@ pub fn main() !void { | ... | @@ -9,7 +9,7 @@ pub fn main() !void { |
| 9 | var lib = try std.DynLib.open(dynlib_name); | 9 | var lib = try std.DynLib.open(dynlib_name); |
| 10 | defer lib.close(); | 10 | defer lib.close(); |
| 11 | 11 | ||
| 12 | const addFn = lib.lookup(extern fn (i32, i32) i32, "add") orelse return error.SymbolNotFound; | 12 | const addFn = lib.lookup(fn (i32, i32) callconv(.C) i32, "add") orelse return error.SymbolNotFound; |
| 13 | 13 | ||
| 14 | const result = addFn(12, 34); | 14 | const result = addFn(12, 34); |
| 15 | std.debug.assert(result == 46); | 15 | std.debug.assert(result == 46); |
test/translate_c.zig+2-2| ... | @@ -238,7 +238,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -238,7 +238,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 238 | \\pub extern fn foo() void; | 238 | \\pub extern fn foo() void; |
| 239 | \\pub export fn bar() void { | 239 | \\pub export fn bar() void { |
| 240 | \\ var func_ptr: ?*c_void = @ptrCast(?*c_void, foo); | 240 | \\ var func_ptr: ?*c_void = @ptrCast(?*c_void, foo); |
| 241 | \\ var typed_func_ptr: ?extern fn () void = @intToPtr(?extern fn () void, @intCast(c_ulong, @ptrToInt(func_ptr))); | 241 | \\ var typed_func_ptr: ?fn () callconv(.C) void = @intToPtr(?fn () callconv(.C) void, @intCast(c_ulong, @ptrToInt(func_ptr))); |
| 242 | \\} | 242 | \\} |
| 243 | }); | 243 | }); |
| 244 | 244 | ||
| ... | @@ -2297,7 +2297,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { | ... | @@ -2297,7 +2297,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void { |
| 2297 | \\} | 2297 | \\} |
| 2298 | , &[_][]const u8{ | 2298 | , &[_][]const u8{ |
| 2299 | \\pub fn bar() callconv(.C) void {} | 2299 | \\pub fn bar() callconv(.C) void {} |
| 2300 | \\pub export fn foo(arg_baz: ?extern fn () [*c]c_int) void { | 2300 | \\pub export fn foo(arg_baz: ?fn () callconv(.C) [*c]c_int) void { |
| 2301 | \\ var baz = arg_baz; | 2301 | \\ var baz = arg_baz; |
| 2302 | \\ bar(); | 2302 | \\ bar(); |
| 2303 | \\ _ = baz.?(); | 2303 | \\ _ = baz.?(); |