aboutsummaryrefslogtreecommitdiff
path: root/lib/std/special
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-01-06 15:34:50 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-01-06 15:34:50 -0500
commit53913acaf70f14c519b0fa0e3771d3dc641ac86b (patch)
treecc34d9eb206b47bf85447c7239a7547a59379e1a /lib/std/special
parent5951b79af40212754071157596b8aebbe2414ffb (diff)
downloadzig-53913acaf70f14c519b0fa0e3771d3dc641ac86b.tar.gz
zig-53913acaf70f14c519b0fa0e3771d3dc641ac86b.zip
zig fmt and update `extern fn` to `callconv(.C)`
Diffstat (limited to 'lib/std/special')
-rw-r--r--lib/std/special/c.zig14
-rw-r--r--lib/std/special/compiler_rt.zig38
-rw-r--r--lib/std/special/compiler_rt/addXf3.zig12
-rw-r--r--lib/std/special/compiler_rt/ashlti3.zig2
-rw-r--r--lib/std/special/compiler_rt/ashrti3.zig2
-rw-r--r--lib/std/special/compiler_rt/aulldiv.zig2
-rw-r--r--lib/std/special/compiler_rt/aullrem.zig2
-rw-r--r--lib/std/special/compiler_rt/comparedf2.zig14
-rw-r--r--lib/std/special/compiler_rt/comparesf2.zig14
-rw-r--r--lib/std/special/compiler_rt/comparetf2.zig6
-rw-r--r--lib/std/special/compiler_rt/divdf3.zig2
-rw-r--r--lib/std/special/compiler_rt/divsf3.zig2
-rw-r--r--lib/std/special/compiler_rt/divti3.zig4
-rw-r--r--lib/std/special/compiler_rt/extendXfYf2.zig8
-rw-r--r--lib/std/special/compiler_rt/fixdfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixdfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixdfti.zig2
-rw-r--r--lib/std/special/compiler_rt/fixsfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixsfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixsfti.zig2
-rw-r--r--lib/std/special/compiler_rt/fixtfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixtfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixtfti.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunsdfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunsdfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunsdfti.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunssfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunssfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunssfti.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunstfdi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunstfsi.zig2
-rw-r--r--lib/std/special/compiler_rt/fixunstfti.zig2
-rw-r--r--lib/std/special/compiler_rt/floatdidf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatsiXf.zig6
-rw-r--r--lib/std/special/compiler_rt/floattidf.zig2
-rw-r--r--lib/std/special/compiler_rt/floattisf.zig2
-rw-r--r--lib/std/special/compiler_rt/floattitf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatundidf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatunditf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatunsidf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatunsitf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatuntidf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatuntisf.zig2
-rw-r--r--lib/std/special/compiler_rt/floatuntitf.zig2
-rw-r--r--lib/std/special/compiler_rt/lshrti3.zig2
-rw-r--r--lib/std/special/compiler_rt/modti3.zig4
-rw-r--r--lib/std/special/compiler_rt/mulXf3.zig6
-rw-r--r--lib/std/special/compiler_rt/muldi3.zig2
-rw-r--r--lib/std/special/compiler_rt/mulodi4.zig2
-rw-r--r--lib/std/special/compiler_rt/muloti4.zig2
-rw-r--r--lib/std/special/compiler_rt/multi3.zig4
-rw-r--r--lib/std/special/compiler_rt/negXf2.zig4
-rw-r--r--lib/std/special/compiler_rt/popcountdi2.zig2
-rw-r--r--lib/std/special/compiler_rt/truncXfYf2.zig10
-rw-r--r--lib/std/special/compiler_rt/udivmoddi4.zig2
-rw-r--r--lib/std/special/compiler_rt/udivmodti4.zig4
-rw-r--r--lib/std/special/compiler_rt/udivti3.zig4
-rw-r--r--lib/std/special/compiler_rt/umodti3.zig4
58 files changed, 118 insertions, 120 deletions
diff --git a/lib/std/special/c.zig b/lib/std/special/c.zig
index 1e63d9911f..604bfd277a 100644
--- a/lib/std/special/c.zig
+++ b/lib/std/special/c.zig
@@ -40,19 +40,19 @@ comptime {
extern var _fltused: c_int = 1;
extern fn main(argc: c_int, argv: [*:null]?[*:0]u8) c_int;
-extern fn wasm_start() void {
+fn wasm_start() callconv(.C) void {
_ = main(0, undefined);
}
-extern fn strcmp(s1: [*:0]const u8, s2: [*:0]const u8) c_int {
+fn strcmp(s1: [*:0]const u8, s2: [*:0]const u8) callconv(.C) c_int {
return std.cstr.cmp(s1, s2);
}
-extern fn strlen(s: [*:0]const u8) usize {
+fn strlen(s: [*:0]const u8) callconv(.C) usize {
return std.mem.len(u8, s);
}
-extern fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) c_int {
+fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) callconv(.C) c_int {
if (_n == 0) return 0;
var l = _l;
var r = _r;
@@ -65,7 +65,7 @@ extern fn strncmp(_l: [*:0]const u8, _r: [*:0]const u8, _n: usize) c_int {
return @as(c_int, l[0]) - @as(c_int, r[0]);
}
-extern fn strerror(errnum: c_int) [*:0]const u8 {
+fn strerror(errnum: c_int) callconv(.C) [*:0]const u8 {
return "TODO strerror implementation";
}
@@ -188,7 +188,7 @@ comptime {
@export("clone", clone, builtin.GlobalLinkage.Strong);
}
}
-extern fn __stack_chk_fail() noreturn {
+fn __stack_chk_fail() callconv(.C) noreturn {
@panic("stack smashing detected");
}
@@ -750,7 +750,6 @@ test "sqrt special" {
std.testing.expect(std.math.isNan(sqrt(std.math.nan(f64))));
}
-
export fn sqrtf(x: f32) f32 {
const tiny: f32 = 1.0e-30;
const sign: i32 = @bitCast(i32, @as(u32, 0x80000000));
@@ -848,4 +847,3 @@ test "sqrtf special" {
std.testing.expect(std.math.isNan(sqrtf(-1.0)));
std.testing.expect(std.math.isNan(sqrtf(std.math.nan(f32))));
}
-
diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig
index f821918ccc..3a6e9c97e2 100644
--- a/lib/std/special/compiler_rt.zig
+++ b/lib/std/special/compiler_rt.zig
@@ -309,7 +309,7 @@ pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn
}
}
-extern fn __stack_chk_fail() noreturn {
+fn __stack_chk_fail() callconv(.C) noreturn {
@panic("stack smashing detected");
}
@@ -320,17 +320,17 @@ extern var __stack_chk_guard: usize = blk: {
break :blk @bitCast(usize, buf);
};
-extern fn __aeabi_unwind_cpp_pr0() void {
+fn __aeabi_unwind_cpp_pr0() callconv(.C) void {
unreachable;
}
-extern fn __aeabi_unwind_cpp_pr1() void {
+fn __aeabi_unwind_cpp_pr1() callconv(.C) void {
unreachable;
}
-extern fn __aeabi_unwind_cpp_pr2() void {
+fn __aeabi_unwind_cpp_pr2() callconv(.C) void {
unreachable;
}
-extern fn __divmoddi4(a: i64, b: i64, rem: *i64) i64 {
+fn __divmoddi4(a: i64, b: i64, rem: *i64) callconv(.C) i64 {
@setRuntimeSafety(is_test);
const d = __divdi3(a, b);
@@ -338,7 +338,7 @@ extern fn __divmoddi4(a: i64, b: i64, rem: *i64) i64 {
return d;
}
-extern fn __divdi3(a: i64, b: i64) i64 {
+fn __divdi3(a: i64, b: i64) callconv(.C) i64 {
@setRuntimeSafety(is_test);
// Set aside the sign of the quotient.
@@ -352,7 +352,7 @@ extern fn __divdi3(a: i64, b: i64) i64 {
return @bitCast(i64, (res ^ sign) -% sign);
}
-extern fn __moddi3(a: i64, b: i64) i64 {
+fn __moddi3(a: i64, b: i64) callconv(.C) i64 {
@setRuntimeSafety(is_test);
// 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 {
return (@bitCast(i64, r) ^ (a >> 63)) -% (a >> 63);
}
-extern fn __udivdi3(a: u64, b: u64) u64 {
+fn __udivdi3(a: u64, b: u64) callconv(.C) u64 {
@setRuntimeSafety(is_test);
return __udivmoddi4(a, b, null);
}
-extern fn __umoddi3(a: u64, b: u64) u64 {
+fn __umoddi3(a: u64, b: u64) callconv(.C) u64 {
@setRuntimeSafety(is_test);
var r: u64 = undefined;
@@ -378,7 +378,7 @@ extern fn __umoddi3(a: u64, b: u64) u64 {
return r;
}
-extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct {
+fn __aeabi_uidivmod(n: u32, d: u32) callconv(.C) extern struct {
q: u32,
r: u32,
} {
@@ -389,7 +389,7 @@ extern fn __aeabi_uidivmod(n: u32, d: u32) extern struct {
return result;
}
-extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct {
+fn __aeabi_uldivmod(n: u64, d: u64) callconv(.C) extern struct {
q: u64,
r: u64,
} {
@@ -400,7 +400,7 @@ extern fn __aeabi_uldivmod(n: u64, d: u64) extern struct {
return result;
}
-extern fn __aeabi_idivmod(n: i32, d: i32) extern struct {
+fn __aeabi_idivmod(n: i32, d: i32) callconv(.C) extern struct {
q: i32,
r: i32,
} {
@@ -411,7 +411,7 @@ extern fn __aeabi_idivmod(n: i32, d: i32) extern struct {
return result;
}
-extern fn __aeabi_ldivmod(n: i64, d: i64) extern struct {
+fn __aeabi_ldivmod(n: i64, d: i64) callconv(.C) extern struct {
q: i64,
r: i64,
} {
@@ -635,7 +635,7 @@ fn __aeabi_memcmp() callconv(.Naked) noreturn {
unreachable;
}
-extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 {
+fn __divmodsi4(a: i32, b: i32, rem: *i32) callconv(.C) i32 {
@setRuntimeSafety(is_test);
const d = __divsi3(a, b);
@@ -643,7 +643,7 @@ extern fn __divmodsi4(a: i32, b: i32, rem: *i32) i32 {
return d;
}
-extern fn __udivmodsi4(a: u32, b: u32, rem: *u32) u32 {
+fn __udivmodsi4(a: u32, b: u32, rem: *u32) callconv(.C) u32 {
@setRuntimeSafety(is_test);
const d = __udivsi3(a, b);
@@ -651,7 +651,7 @@ extern fn __udivmodsi4(a: u32, b: u32, rem: *u32) u32 {
return d;
}
-extern fn __divsi3(n: i32, d: i32) i32 {
+fn __divsi3(n: i32, d: i32) callconv(.C) i32 {
@setRuntimeSafety(is_test);
// Set aside the sign of the quotient.
@@ -665,7 +665,7 @@ extern fn __divsi3(n: i32, d: i32) i32 {
return @bitCast(i32, (res ^ sign) -% sign);
}
-extern fn __udivsi3(n: u32, d: u32) u32 {
+fn __udivsi3(n: u32, d: u32) callconv(.C) u32 {
@setRuntimeSafety(is_test);
const n_uword_bits: c_uint = u32.bit_count;
@@ -706,13 +706,13 @@ extern fn __udivsi3(n: u32, d: u32) u32 {
return q;
}
-extern fn __modsi3(n: i32, d: i32) i32 {
+fn __modsi3(n: i32, d: i32) callconv(.C) i32 {
@setRuntimeSafety(is_test);
return n -% __divsi3(n, d) *% d;
}
-extern fn __umodsi3(n: u32, d: u32) u32 {
+fn __umodsi3(n: u32, d: u32) callconv(.C) u32 {
@setRuntimeSafety(is_test);
return n -% __udivsi3(n, d) *% d;
diff --git a/lib/std/special/compiler_rt/addXf3.zig b/lib/std/special/compiler_rt/addXf3.zig
index e3dd1819c3..ac38e1c8cd 100644
--- a/lib/std/special/compiler_rt/addXf3.zig
+++ b/lib/std/special/compiler_rt/addXf3.zig
@@ -6,29 +6,29 @@ const std = @import("std");
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __addsf3(a: f32, b: f32) f32 {
+pub fn __addsf3(a: f32, b: f32) callconv(.C) f32 {
return addXf3(f32, a, b);
}
-pub extern fn __adddf3(a: f64, b: f64) f64 {
+pub fn __adddf3(a: f64, b: f64) callconv(.C) f64 {
return addXf3(f64, a, b);
}
-pub extern fn __addtf3(a: f128, b: f128) f128 {
+pub fn __addtf3(a: f128, b: f128) callconv(.C) f128 {
return addXf3(f128, a, b);
}
-pub extern fn __subsf3(a: f32, b: f32) f32 {
+pub fn __subsf3(a: f32, b: f32) callconv(.C) f32 {
const neg_b = @bitCast(f32, @bitCast(u32, b) ^ (@as(u32, 1) << 31));
return addXf3(f32, a, neg_b);
}
-pub extern fn __subdf3(a: f64, b: f64) f64 {
+pub fn __subdf3(a: f64, b: f64) callconv(.C) f64 {
const neg_b = @bitCast(f64, @bitCast(u64, b) ^ (@as(u64, 1) << 63));
return addXf3(f64, a, neg_b);
}
-pub extern fn __subtf3(a: f128, b: f128) f128 {
+pub fn __subtf3(a: f128, b: f128) callconv(.C) f128 {
const neg_b = @bitCast(f128, @bitCast(u128, b) ^ (@as(u128, 1) << 127));
return addXf3(f128, a, neg_b);
}
diff --git a/lib/std/special/compiler_rt/ashlti3.zig b/lib/std/special/compiler_rt/ashlti3.zig
index 65b23f22e5..211515f9dd 100644
--- a/lib/std/special/compiler_rt/ashlti3.zig
+++ b/lib/std/special/compiler_rt/ashlti3.zig
@@ -1,7 +1,7 @@
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __ashlti3(a: i128, b: i32) i128 {
+pub fn __ashlti3(a: i128, b: i32) callconv(.C) i128 {
var input = twords{ .all = a };
var result: twords = undefined;
diff --git a/lib/std/special/compiler_rt/ashrti3.zig b/lib/std/special/compiler_rt/ashrti3.zig
index 40ee89c3c4..1bcd40d2e4 100644
--- a/lib/std/special/compiler_rt/ashrti3.zig
+++ b/lib/std/special/compiler_rt/ashrti3.zig
@@ -1,7 +1,7 @@
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __ashrti3(a: i128, b: i32) i128 {
+pub fn __ashrti3(a: i128, b: i32) callconv(.C) i128 {
var input = twords{ .all = a };
var result: twords = undefined;
diff --git a/lib/std/special/compiler_rt/aulldiv.zig b/lib/std/special/compiler_rt/aulldiv.zig
index afc96492c1..2e2dd364d5 100644
--- a/lib/std/special/compiler_rt/aulldiv.zig
+++ b/lib/std/special/compiler_rt/aulldiv.zig
@@ -1,6 +1,6 @@
const builtin = @import("builtin");
-pub extern fn _alldiv(a: i64, b: i64) callconv(.Stdcall) i64 {
+pub fn _alldiv(a: i64, b: i64) callconv(.Stdcall) i64 {
@setRuntimeSafety(builtin.is_test);
const s_a = a >> (i64.bit_count - 1);
const s_b = b >> (i64.bit_count - 1);
diff --git a/lib/std/special/compiler_rt/aullrem.zig b/lib/std/special/compiler_rt/aullrem.zig
index 748aaa0f89..4244f1bb80 100644
--- a/lib/std/special/compiler_rt/aullrem.zig
+++ b/lib/std/special/compiler_rt/aullrem.zig
@@ -1,6 +1,6 @@
const builtin = @import("builtin");
-pub extern fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 {
+pub fn _allrem(a: i64, b: i64) callconv(.Stdcall) i64 {
@setRuntimeSafety(builtin.is_test);
const s_a = a >> (i64.bit_count - 1);
const s_b = b >> (i64.bit_count - 1);
diff --git a/lib/std/special/compiler_rt/comparedf2.zig b/lib/std/special/compiler_rt/comparedf2.zig
index 95dc878630..b6e08c49f4 100644
--- a/lib/std/special/compiler_rt/comparedf2.zig
+++ b/lib/std/special/compiler_rt/comparedf2.zig
@@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0);
const LE_GREATER = @as(c_int, 1);
const LE_UNORDERED = @as(c_int, 1);
-pub extern fn __ledf2(a: fp_t, b: fp_t) c_int {
+pub fn __ledf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt: srep_t = @bitCast(srep_t, a);
const bInt: srep_t = @bitCast(srep_t, b);
@@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0);
const GE_GREATER = @as(c_int, 1);
const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED
-pub extern fn __gedf2(a: fp_t, b: fp_t) c_int {
+pub fn __gedf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt: srep_t = @bitCast(srep_t, a);
const bInt: srep_t = @bitCast(srep_t, b);
@@ -94,26 +94,26 @@ pub extern fn __gedf2(a: fp_t, b: fp_t) c_int {
}
}
-pub extern fn __unorddf2(a: fp_t, b: fp_t) c_int {
+pub fn __unorddf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aAbs: rep_t = @bitCast(rep_t, a) & absMask;
const bAbs: rep_t = @bitCast(rep_t, b) & absMask;
return @boolToInt(aAbs > infRep or bAbs > infRep);
}
-pub extern fn __eqdf2(a: fp_t, b: fp_t) c_int {
+pub fn __eqdf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __ledf2(a, b);
}
-pub extern fn __ltdf2(a: fp_t, b: fp_t) c_int {
+pub fn __ltdf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __ledf2(a, b);
}
-pub extern fn __nedf2(a: fp_t, b: fp_t) c_int {
+pub fn __nedf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __ledf2(a, b);
}
-pub extern fn __gtdf2(a: fp_t, b: fp_t) c_int {
+pub fn __gtdf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __gedf2(a, b);
}
diff --git a/lib/std/special/compiler_rt/comparesf2.zig b/lib/std/special/compiler_rt/comparesf2.zig
index 4468da4fbe..fdb5737ad3 100644
--- a/lib/std/special/compiler_rt/comparesf2.zig
+++ b/lib/std/special/compiler_rt/comparesf2.zig
@@ -27,7 +27,7 @@ const LE_EQUAL = @as(c_int, 0);
const LE_GREATER = @as(c_int, 1);
const LE_UNORDERED = @as(c_int, 1);
-pub extern fn __lesf2(a: fp_t, b: fp_t) c_int {
+pub fn __lesf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt: srep_t = @bitCast(srep_t, a);
const bInt: srep_t = @bitCast(srep_t, b);
@@ -70,7 +70,7 @@ const GE_EQUAL = @as(c_int, 0);
const GE_GREATER = @as(c_int, 1);
const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED
-pub extern fn __gesf2(a: fp_t, b: fp_t) c_int {
+pub fn __gesf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt: srep_t = @bitCast(srep_t, a);
const bInt: srep_t = @bitCast(srep_t, b);
@@ -94,26 +94,26 @@ pub extern fn __gesf2(a: fp_t, b: fp_t) c_int {
}
}
-pub extern fn __unordsf2(a: fp_t, b: fp_t) c_int {
+pub fn __unordsf2(a: fp_t, b: fp_t) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aAbs: rep_t = @bitCast(rep_t, a) & absMask;
const bAbs: rep_t = @bitCast(rep_t, b) & absMask;
return @boolToInt(aAbs > infRep or bAbs > infRep);
}
-pub extern fn __eqsf2(a: fp_t, b: fp_t) c_int {
+pub fn __eqsf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __lesf2(a, b);
}
-pub extern fn __ltsf2(a: fp_t, b: fp_t) c_int {
+pub fn __ltsf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __lesf2(a, b);
}
-pub extern fn __nesf2(a: fp_t, b: fp_t) c_int {
+pub fn __nesf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __lesf2(a, b);
}
-pub extern fn __gtsf2(a: fp_t, b: fp_t) c_int {
+pub fn __gtsf2(a: fp_t, b: fp_t) callconv(.C) c_int {
return __gesf2(a, b);
}
diff --git a/lib/std/special/compiler_rt/comparetf2.zig b/lib/std/special/compiler_rt/comparetf2.zig
index e973018455..f2969f2112 100644
--- a/lib/std/special/compiler_rt/comparetf2.zig
+++ b/lib/std/special/compiler_rt/comparetf2.zig
@@ -21,7 +21,7 @@ const infRep = exponentMask;
const builtin = @import("builtin");
const is_test = builtin.is_test;
-pub extern fn __letf2(a: f128, b: f128) c_int {
+pub fn __letf2(a: f128, b: f128) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt = @bitCast(rep_t, a);
@@ -65,7 +65,7 @@ const GE_EQUAL = @as(c_int, 0);
const GE_GREATER = @as(c_int, 1);
const GE_UNORDERED = @as(c_int, -1); // Note: different from LE_UNORDERED
-pub extern fn __getf2(a: f128, b: f128) c_int {
+pub fn __getf2(a: f128, b: f128) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aInt = @bitCast(srep_t, a);
@@ -90,7 +90,7 @@ pub extern fn __getf2(a: f128, b: f128) c_int {
GE_GREATER;
}
-pub extern fn __unordtf2(a: f128, b: f128) c_int {
+pub fn __unordtf2(a: f128, b: f128) callconv(.C) c_int {
@setRuntimeSafety(is_test);
const aAbs = @bitCast(rep_t, a) & absMask;
diff --git a/lib/std/special/compiler_rt/divdf3.zig b/lib/std/special/compiler_rt/divdf3.zig
index 9937b09497..a8afd4a3a6 100644
--- a/lib/std/special/compiler_rt/divdf3.zig
+++ b/lib/std/special/compiler_rt/divdf3.zig
@@ -5,7 +5,7 @@
const std = @import("std");
const builtin = @import("builtin");
-pub extern fn __divdf3(a: f64, b: f64) f64 {
+pub fn __divdf3(a: f64, b: f64) callconv(.C) f64 {
@setRuntimeSafety(builtin.is_test);
const Z = @IntType(false, f64.bit_count);
const SignedZ = @IntType(true, f64.bit_count);
diff --git a/lib/std/special/compiler_rt/divsf3.zig b/lib/std/special/compiler_rt/divsf3.zig
index 4ee2eed36c..ea882b4927 100644
--- a/lib/std/special/compiler_rt/divsf3.zig
+++ b/lib/std/special/compiler_rt/divsf3.zig
@@ -5,7 +5,7 @@
const std = @import("std");
const builtin = @import("builtin");
-pub extern fn __divsf3(a: f32, b: f32) f32 {
+pub fn __divsf3(a: f32, b: f32) callconv(.C) f32 {
@setRuntimeSafety(builtin.is_test);
const Z = @IntType(false, f32.bit_count);
diff --git a/lib/std/special/compiler_rt/divti3.zig b/lib/std/special/compiler_rt/divti3.zig
index fcb23a50d9..2b878f5269 100644
--- a/lib/std/special/compiler_rt/divti3.zig
+++ b/lib/std/special/compiler_rt/divti3.zig
@@ -1,7 +1,7 @@
const udivmod = @import("udivmod.zig").udivmod;
const builtin = @import("builtin");
-pub extern fn __divti3(a: i128, b: i128) i128 {
+pub fn __divti3(a: i128, b: i128) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
const s_a = a >> (i128.bit_count - 1);
@@ -16,7 +16,7 @@ pub extern fn __divti3(a: i128, b: i128) i128 {
}
const v128 = @Vector(2, u64);
-pub extern fn __divti3_windows_x86_64(a: v128, b: v128) v128 {
+pub fn __divti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
return @bitCast(v128, @call(.{ .modifier = .always_inline }, __divti3, .{
@bitCast(i128, a),
@bitCast(i128, b),
diff --git a/lib/std/special/compiler_rt/extendXfYf2.zig b/lib/std/special/compiler_rt/extendXfYf2.zig
index 427bd4ec24..10227043aa 100644
--- a/lib/std/special/compiler_rt/extendXfYf2.zig
+++ b/lib/std/special/compiler_rt/extendXfYf2.zig
@@ -2,19 +2,19 @@ const std = @import("std");
const builtin = @import("builtin");
const is_test = builtin.is_test;
-pub extern fn __extendsfdf2(a: f32) f64 {
+pub fn __extendsfdf2(a: f32) callconv(.C) f64 {
return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f64, f32, @bitCast(u32, a) });
}
-pub extern fn __extenddftf2(a: f64) f128 {
+pub fn __extenddftf2(a: f64) callconv(.C) f128 {
return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f64, @bitCast(u64, a) });
}
-pub extern fn __extendsftf2(a: f32) f128 {
+pub fn __extendsftf2(a: f32) callconv(.C) f128 {
return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f128, f32, @bitCast(u32, a) });
}
-pub extern fn __extendhfsf2(a: u16) f32 {
+pub fn __extendhfsf2(a: u16) callconv(.C) f32 {
return @call(.{ .modifier = .always_inline }, extendXfYf2, .{ f32, f16, a });
}
diff --git a/lib/std/special/compiler_rt/fixdfdi.zig b/lib/std/special/compiler_rt/fixdfdi.zig
index c108fd15aa..fb3b31d6e8 100644
--- a/lib/std/special/compiler_rt/fixdfdi.zig
+++ b/lib/std/special/compiler_rt/fixdfdi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixdfdi(a: f64) i64 {
+pub fn __fixdfdi(a: f64) callconv(.C) i64 {
@setRuntimeSafety(builtin.is_test);
return fixint(f64, i64, a);
}
diff --git a/lib/std/special/compiler_rt/fixdfsi.zig b/lib/std/special/compiler_rt/fixdfsi.zig
index 83a17b2b0d..de21c86e43 100644
--- a/lib/std/special/compiler_rt/fixdfsi.zig
+++ b/lib/std/special/compiler_rt/fixdfsi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixdfsi(a: f64) i32 {
+pub fn __fixdfsi(a: f64) callconv(.C) i32 {
@setRuntimeSafety(builtin.is_test);
return fixint(f64, i32, a);
}
diff --git a/lib/std/special/compiler_rt/fixdfti.zig b/lib/std/special/compiler_rt/fixdfti.zig
index e30f885cf6..0e21f0ba19 100644
--- a/lib/std/special/compiler_rt/fixdfti.zig
+++ b/lib/std/special/compiler_rt/fixdfti.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixdfti(a: f64) i128 {
+pub fn __fixdfti(a: f64) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
return fixint(f64, i128, a);
}
diff --git a/lib/std/special/compiler_rt/fixsfdi.zig b/lib/std/special/compiler_rt/fixsfdi.zig
index ffa81d13ab..d3aaf9d470 100644
--- a/lib/std/special/compiler_rt/fixsfdi.zig
+++ b/lib/std/special/compiler_rt/fixsfdi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixsfdi(a: f32) i64 {
+pub fn __fixsfdi(a: f32) callconv(.C) i64 {
@setRuntimeSafety(builtin.is_test);
return fixint(f32, i64, a);
}
diff --git a/lib/std/special/compiler_rt/fixsfsi.zig b/lib/std/special/compiler_rt/fixsfsi.zig
index 9a94b4395b..81aa01dfa1 100644
--- a/lib/std/special/compiler_rt/fixsfsi.zig
+++ b/lib/std/special/compiler_rt/fixsfsi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixsfsi(a: f32) i32 {
+pub fn __fixsfsi(a: f32) callconv(.C) i32 {
@setRuntimeSafety(builtin.is_test);
return fixint(f32, i32, a);
}
diff --git a/lib/std/special/compiler_rt/fixsfti.zig b/lib/std/special/compiler_rt/fixsfti.zig
index 806a1678aa..d7ce4b3a60 100644
--- a/lib/std/special/compiler_rt/fixsfti.zig
+++ b/lib/std/special/compiler_rt/fixsfti.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixsfti(a: f32) i128 {
+pub fn __fixsfti(a: f32) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
return fixint(f32, i128, a);
}
diff --git a/lib/std/special/compiler_rt/fixtfdi.zig b/lib/std/special/compiler_rt/fixtfdi.zig
index 8d99231b74..0ef3aa2259 100644
--- a/lib/std/special/compiler_rt/fixtfdi.zig
+++ b/lib/std/special/compiler_rt/fixtfdi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixtfdi(a: f128) i64 {
+pub fn __fixtfdi(a: f128) callconv(.C) i64 {
@setRuntimeSafety(builtin.is_test);
return fixint(f128, i64, a);
}
diff --git a/lib/std/special/compiler_rt/fixtfsi.zig b/lib/std/special/compiler_rt/fixtfsi.zig
index f3f83634b2..15e89a11b0 100644
--- a/lib/std/special/compiler_rt/fixtfsi.zig
+++ b/lib/std/special/compiler_rt/fixtfsi.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixtfsi(a: f128) i32 {
+pub fn __fixtfsi(a: f128) callconv(.C) i32 {
@setRuntimeSafety(builtin.is_test);
return fixint(f128, i32, a);
}
diff --git a/lib/std/special/compiler_rt/fixtfti.zig b/lib/std/special/compiler_rt/fixtfti.zig
index 07d38f2c3b..733fa1eed1 100644
--- a/lib/std/special/compiler_rt/fixtfti.zig
+++ b/lib/std/special/compiler_rt/fixtfti.zig
@@ -1,7 +1,7 @@
const fixint = @import("fixint.zig").fixint;
const builtin = @import("builtin");
-pub extern fn __fixtfti(a: f128) i128 {
+pub fn __fixtfti(a: f128) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
return fixint(f128, i128, a);
}
diff --git a/lib/std/special/compiler_rt/fixunsdfdi.zig b/lib/std/special/compiler_rt/fixunsdfdi.zig
index 1fa7ed758e..9d41d4b740 100644
--- a/lib/std/special/compiler_rt/fixunsdfdi.zig
+++ b/lib/std/special/compiler_rt/fixunsdfdi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunsdfdi(a: f64) u64 {
+pub fn __fixunsdfdi(a: f64) callconv(.C) u64 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f64, u64, a);
}
diff --git a/lib/std/special/compiler_rt/fixunsdfsi.zig b/lib/std/special/compiler_rt/fixunsdfsi.zig
index a77cb8df89..044523512c 100644
--- a/lib/std/special/compiler_rt/fixunsdfsi.zig
+++ b/lib/std/special/compiler_rt/fixunsdfsi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunsdfsi(a: f64) u32 {
+pub fn __fixunsdfsi(a: f64) callconv(.C) u32 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f64, u32, a);
}
diff --git a/lib/std/special/compiler_rt/fixunsdfti.zig b/lib/std/special/compiler_rt/fixunsdfti.zig
index 6e1ded46e5..3dcec6bf89 100644
--- a/lib/std/special/compiler_rt/fixunsdfti.zig
+++ b/lib/std/special/compiler_rt/fixunsdfti.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunsdfti(a: f64) u128 {
+pub fn __fixunsdfti(a: f64) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f64, u128, a);
}
diff --git a/lib/std/special/compiler_rt/fixunssfdi.zig b/lib/std/special/compiler_rt/fixunssfdi.zig
index 36d4acc28c..a42121aeec 100644
--- a/lib/std/special/compiler_rt/fixunssfdi.zig
+++ b/lib/std/special/compiler_rt/fixunssfdi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunssfdi(a: f32) u64 {
+pub fn __fixunssfdi(a: f32) callconv(.C) u64 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f32, u64, a);
}
diff --git a/lib/std/special/compiler_rt/fixunssfsi.zig b/lib/std/special/compiler_rt/fixunssfsi.zig
index 53130286a1..00f7c8ad22 100644
--- a/lib/std/special/compiler_rt/fixunssfsi.zig
+++ b/lib/std/special/compiler_rt/fixunssfsi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunssfsi(a: f32) u32 {
+pub fn __fixunssfsi(a: f32) callconv(.C) u32 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f32, u32, a);
}
diff --git a/lib/std/special/compiler_rt/fixunssfti.zig b/lib/std/special/compiler_rt/fixunssfti.zig
index f0cd788d2e..dff9eb7498 100644
--- a/lib/std/special/compiler_rt/fixunssfti.zig
+++ b/lib/std/special/compiler_rt/fixunssfti.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunssfti(a: f32) u128 {
+pub fn __fixunssfti(a: f32) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f32, u128, a);
}
diff --git a/lib/std/special/compiler_rt/fixunstfdi.zig b/lib/std/special/compiler_rt/fixunstfdi.zig
index e352044708..907116c165 100644
--- a/lib/std/special/compiler_rt/fixunstfdi.zig
+++ b/lib/std/special/compiler_rt/fixunstfdi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunstfdi(a: f128) u64 {
+pub fn __fixunstfdi(a: f128) callconv(.C) u64 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f128, u64, a);
}
diff --git a/lib/std/special/compiler_rt/fixunstfsi.zig b/lib/std/special/compiler_rt/fixunstfsi.zig
index 579c559790..c66a3f18b4 100644
--- a/lib/std/special/compiler_rt/fixunstfsi.zig
+++ b/lib/std/special/compiler_rt/fixunstfsi.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunstfsi(a: f128) u32 {
+pub fn __fixunstfsi(a: f128) callconv(.C) u32 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f128, u32, a);
}
diff --git a/lib/std/special/compiler_rt/fixunstfti.zig b/lib/std/special/compiler_rt/fixunstfti.zig
index cd6178164a..1867c69234 100644
--- a/lib/std/special/compiler_rt/fixunstfti.zig
+++ b/lib/std/special/compiler_rt/fixunstfti.zig
@@ -1,7 +1,7 @@
const fixuint = @import("fixuint.zig").fixuint;
const builtin = @import("builtin");
-pub extern fn __fixunstfti(a: f128) u128 {
+pub fn __fixunstfti(a: f128) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
return fixuint(f128, u128, a);
}
diff --git a/lib/std/special/compiler_rt/floatdidf.zig b/lib/std/special/compiler_rt/floatdidf.zig
index 1610136413..93bd0c8a3e 100644
--- a/lib/std/special/compiler_rt/floatdidf.zig
+++ b/lib/std/special/compiler_rt/floatdidf.zig
@@ -4,7 +4,7 @@ const std = @import("std");
const twop52: f64 = 0x1.0p52;
const twop32: f64 = 0x1.0p32;
-pub extern fn __floatdidf(a: i64) f64 {
+pub fn __floatdidf(a: i64) callconv(.C) f64 {
@setRuntimeSafety(builtin.is_test);
if (a == 0) return 0;
diff --git a/lib/std/special/compiler_rt/floatsiXf.zig b/lib/std/special/compiler_rt/floatsiXf.zig
index 917dfb47fc..30a09de90c 100644
--- a/lib/std/special/compiler_rt/floatsiXf.zig
+++ b/lib/std/special/compiler_rt/floatsiXf.zig
@@ -53,17 +53,17 @@ fn floatsiXf(comptime T: type, a: i32) T {
return @bitCast(T, result);
}
-pub extern fn __floatsisf(arg: i32) f32 {
+pub fn __floatsisf(arg: i32) callconv(.C) f32 {
@setRuntimeSafety(builtin.is_test);
return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f32, arg });
}
-pub extern fn __floatsidf(arg: i32) f64 {
+pub fn __floatsidf(arg: i32) callconv(.C) f64 {
@setRuntimeSafety(builtin.is_test);
return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f64, arg });
}
-pub extern fn __floatsitf(arg: i32) f128 {
+pub fn __floatsitf(arg: i32) callconv(.C) f128 {
@setRuntimeSafety(builtin.is_test);
return @call(.{ .modifier = .always_inline }, floatsiXf, .{ f128, arg });
}
diff --git a/lib/std/special/compiler_rt/floattidf.zig b/lib/std/special/compiler_rt/floattidf.zig
index 1e83674598..6b5013287b 100644
--- a/lib/std/special/compiler_rt/floattidf.zig
+++ b/lib/std/special/compiler_rt/floattidf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const DBL_MANT_DIG = 53;
-pub extern fn __floattidf(arg: i128) f64 {
+pub fn __floattidf(arg: i128) callconv(.C) f64 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/floattisf.zig b/lib/std/special/compiler_rt/floattisf.zig
index 0c02bfff1f..3f020dadd8 100644
--- a/lib/std/special/compiler_rt/floattisf.zig
+++ b/lib/std/special/compiler_rt/floattisf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const FLT_MANT_DIG = 24;
-pub extern fn __floattisf(arg: i128) f32 {
+pub fn __floattisf(arg: i128) callconv(.C) f32 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/floattitf.zig b/lib/std/special/compiler_rt/floattitf.zig
index aac22e36d0..90bc241306 100644
--- a/lib/std/special/compiler_rt/floattitf.zig
+++ b/lib/std/special/compiler_rt/floattitf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const LDBL_MANT_DIG = 113;
-pub extern fn __floattitf(arg: i128) f128 {
+pub fn __floattitf(arg: i128) callconv(.C) f128 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/floatundidf.zig b/lib/std/special/compiler_rt/floatundidf.zig
index 68759a2acd..c8803b4c6c 100644
--- a/lib/std/special/compiler_rt/floatundidf.zig
+++ b/lib/std/special/compiler_rt/floatundidf.zig
@@ -5,7 +5,7 @@ const twop52: f64 = 0x1.0p52;
const twop84: f64 = 0x1.0p84;
const twop84_plus_twop52: f64 = 0x1.00000001p84;
-pub extern fn __floatundidf(a: u64) f64 {
+pub fn __floatundidf(a: u64) callconv(.C) f64 {
@setRuntimeSafety(builtin.is_test);
if (a == 0) return 0;
diff --git a/lib/std/special/compiler_rt/floatunditf.zig b/lib/std/special/compiler_rt/floatunditf.zig
index 9af83a2b5d..b574d21bd8 100644
--- a/lib/std/special/compiler_rt/floatunditf.zig
+++ b/lib/std/special/compiler_rt/floatunditf.zig
@@ -2,7 +2,7 @@ const builtin = @import("builtin");
const is_test = builtin.is_test;
const std = @import("std");
-pub extern fn __floatunditf(a: u128) f128 {
+pub fn __floatunditf(a: u128) callconv(.C) f128 {
@setRuntimeSafety(is_test);
if (a == 0) {
diff --git a/lib/std/special/compiler_rt/floatunsidf.zig b/lib/std/special/compiler_rt/floatunsidf.zig
index d744009aea..92a7870806 100644
--- a/lib/std/special/compiler_rt/floatunsidf.zig
+++ b/lib/std/special/compiler_rt/floatunsidf.zig
@@ -4,7 +4,7 @@ const maxInt = std.math.maxInt;
const implicitBit = @as(u64, 1) << 52;
-pub extern fn __floatunsidf(arg: u32) f64 {
+pub fn __floatunsidf(arg: u32) callconv(.C) f64 {
@setRuntimeSafety(builtin.is_test);
if (arg == 0) return 0.0;
diff --git a/lib/std/special/compiler_rt/floatunsitf.zig b/lib/std/special/compiler_rt/floatunsitf.zig
index 18397f8ad0..a10ff6b703 100644
--- a/lib/std/special/compiler_rt/floatunsitf.zig
+++ b/lib/std/special/compiler_rt/floatunsitf.zig
@@ -2,7 +2,7 @@ const builtin = @import("builtin");
const is_test = builtin.is_test;
const std = @import("std");
-pub extern fn __floatunsitf(a: u64) f128 {
+pub fn __floatunsitf(a: u64) callconv(.C) f128 {
@setRuntimeSafety(is_test);
if (a == 0) {
diff --git a/lib/std/special/compiler_rt/floatuntidf.zig b/lib/std/special/compiler_rt/floatuntidf.zig
index 5d3a201058..5b5adc0491 100644
--- a/lib/std/special/compiler_rt/floatuntidf.zig
+++ b/lib/std/special/compiler_rt/floatuntidf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const DBL_MANT_DIG = 53;
-pub extern fn __floatuntidf(arg: u128) f64 {
+pub fn __floatuntidf(arg: u128) callconv(.C) f64 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/floatuntisf.zig b/lib/std/special/compiler_rt/floatuntisf.zig
index e450ad9a48..33e6e41a84 100644
--- a/lib/std/special/compiler_rt/floatuntisf.zig
+++ b/lib/std/special/compiler_rt/floatuntisf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const FLT_MANT_DIG = 24;
-pub extern fn __floatuntisf(arg: u128) f32 {
+pub fn __floatuntisf(arg: u128) callconv(.C) f32 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/floatuntitf.zig b/lib/std/special/compiler_rt/floatuntitf.zig
index f92942e034..0b96076206 100644
--- a/lib/std/special/compiler_rt/floatuntitf.zig
+++ b/lib/std/special/compiler_rt/floatuntitf.zig
@@ -5,7 +5,7 @@ const maxInt = std.math.maxInt;
const LDBL_MANT_DIG = 113;
-pub extern fn __floatuntitf(arg: u128) f128 {
+pub fn __floatuntitf(arg: u128) callconv(.C) f128 {
@setRuntimeSafety(is_test);
if (arg == 0)
diff --git a/lib/std/special/compiler_rt/lshrti3.zig b/lib/std/special/compiler_rt/lshrti3.zig
index 329968ae40..043be5e2a2 100644
--- a/lib/std/special/compiler_rt/lshrti3.zig
+++ b/lib/std/special/compiler_rt/lshrti3.zig
@@ -1,7 +1,7 @@
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __lshrti3(a: i128, b: i32) i128 {
+pub fn __lshrti3(a: i128, b: i32) callconv(.C) i128 {
var input = twords{ .all = a };
var result: twords = undefined;
diff --git a/lib/std/special/compiler_rt/modti3.zig b/lib/std/special/compiler_rt/modti3.zig
index d983ecba5f..a9d1f48468 100644
--- a/lib/std/special/compiler_rt/modti3.zig
+++ b/lib/std/special/compiler_rt/modti3.zig
@@ -6,7 +6,7 @@ const udivmod = @import("udivmod.zig").udivmod;
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __modti3(a: i128, b: i128) i128 {
+pub fn __modti3(a: i128, b: i128) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
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 {
}
const v128 = @Vector(2, u64);
-pub extern fn __modti3_windows_x86_64(a: v128, b: v128) v128 {
+pub fn __modti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
return @bitCast(v128, @call(.{ .modifier = .always_inline }, __modti3, .{
@bitCast(i128, a),
@bitCast(i128, b),
diff --git a/lib/std/special/compiler_rt/mulXf3.zig b/lib/std/special/compiler_rt/mulXf3.zig
index 11ee0b49a4..9457bfb86e 100644
--- a/lib/std/special/compiler_rt/mulXf3.zig
+++ b/lib/std/special/compiler_rt/mulXf3.zig
@@ -6,13 +6,13 @@ const std = @import("std");
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __multf3(a: f128, b: f128) f128 {
+pub fn __multf3(a: f128, b: f128) callconv(.C) f128 {
return mulXf3(f128, a, b);
}
-pub extern fn __muldf3(a: f64, b: f64) f64 {
+pub fn __muldf3(a: f64, b: f64) callconv(.C) f64 {
return mulXf3(f64, a, b);
}
-pub extern fn __mulsf3(a: f32, b: f32) f32 {
+pub fn __mulsf3(a: f32, b: f32) callconv(.C) f32 {
return mulXf3(f32, a, b);
}
diff --git a/lib/std/special/compiler_rt/muldi3.zig b/lib/std/special/compiler_rt/muldi3.zig
index 3efc5a9ac6..4f605d441c 100644
--- a/lib/std/special/compiler_rt/muldi3.zig
+++ b/lib/std/special/compiler_rt/muldi3.zig
@@ -39,7 +39,7 @@ fn __muldsi3(a: u32, b: u32) i64 {
return r.all;
}
-pub extern fn __muldi3(a: i64, b: i64) i64 {
+pub fn __muldi3(a: i64, b: i64) callconv(.C) i64 {
@setRuntimeSafety(builtin.is_test);
const x = dwords{ .all = a };
diff --git a/lib/std/special/compiler_rt/mulodi4.zig b/lib/std/special/compiler_rt/mulodi4.zig
index 21c7fd1f97..b70d1657e7 100644
--- a/lib/std/special/compiler_rt/mulodi4.zig
+++ b/lib/std/special/compiler_rt/mulodi4.zig
@@ -3,7 +3,7 @@ const compiler_rt = @import("../compiler_rt.zig");
const maxInt = std.math.maxInt;
const minInt = std.math.minInt;
-pub extern fn __mulodi4(a: i64, b: i64, overflow: *c_int) i64 {
+pub fn __mulodi4(a: i64, b: i64, overflow: *c_int) callconv(.C) i64 {
@setRuntimeSafety(builtin.is_test);
const min = @bitCast(i64, @as(u64, 1 << (i64.bit_count - 1)));
diff --git a/lib/std/special/compiler_rt/muloti4.zig b/lib/std/special/compiler_rt/muloti4.zig
index ad6ad43808..190959b801 100644
--- a/lib/std/special/compiler_rt/muloti4.zig
+++ b/lib/std/special/compiler_rt/muloti4.zig
@@ -1,7 +1,7 @@
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __muloti4(a: i128, b: i128, overflow: *c_int) i128 {
+pub fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
const min = @bitCast(i128, @as(u128, 1 << (i128.bit_count - 1)));
diff --git a/lib/std/special/compiler_rt/multi3.zig b/lib/std/special/compiler_rt/multi3.zig
index 56ff56cbb2..f46bd55421 100644
--- a/lib/std/special/compiler_rt/multi3.zig
+++ b/lib/std/special/compiler_rt/multi3.zig
@@ -5,7 +5,7 @@ const compiler_rt = @import("../compiler_rt.zig");
// ae684fad6d34858c014c94da69c15e7774a633c3
// 2018-08-13
-pub extern fn __multi3(a: i128, b: i128) i128 {
+pub fn __multi3(a: i128, b: i128) callconv(.C) i128 {
@setRuntimeSafety(builtin.is_test);
const x = twords{ .all = a };
const y = twords{ .all = b };
@@ -15,7 +15,7 @@ pub extern fn __multi3(a: i128, b: i128) i128 {
}
const v128 = @Vector(2, u64);
-pub extern fn __multi3_windows_x86_64(a: v128, b: v128) v128 {
+pub fn __multi3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
return @bitCast(v128, @call(.{ .modifier = .always_inline }, __multi3, .{
@bitCast(i128, a),
@bitCast(i128, b),
diff --git a/lib/std/special/compiler_rt/negXf2.zig b/lib/std/special/compiler_rt/negXf2.zig
index c4be085d62..e21e36b955 100644
--- a/lib/std/special/compiler_rt/negXf2.zig
+++ b/lib/std/special/compiler_rt/negXf2.zig
@@ -1,10 +1,10 @@
const std = @import("std");
-pub extern fn __negsf2(a: f32) f32 {
+pub fn __negsf2(a: f32) callconv(.C) f32 {
return negXf2(f32, a);
}
-pub extern fn __negdf2(a: f64) f64 {
+pub fn __negdf2(a: f64) callconv(.C) f64 {
return negXf2(f64, a);
}
diff --git a/lib/std/special/compiler_rt/popcountdi2.zig b/lib/std/special/compiler_rt/popcountdi2.zig
index ea36b0ec44..b7e7220c7b 100644
--- a/lib/std/special/compiler_rt/popcountdi2.zig
+++ b/lib/std/special/compiler_rt/popcountdi2.zig
@@ -2,7 +2,7 @@ const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
// ported from llvm compiler-rt 8.0.0rc3 95e1c294cb0415a377a7b1d6c7c7d4f89e1c04e4
-pub extern fn __popcountdi2(a: i64) i32 {
+pub fn __popcountdi2(a: i64) callconv(.C) i32 {
var x2 = @bitCast(u64, a);
x2 = x2 - ((x2 >> 1) & 0x5555555555555555);
// Every 2 bits holds the sum of every pair of bits (32)
diff --git a/lib/std/special/compiler_rt/truncXfYf2.zig b/lib/std/special/compiler_rt/truncXfYf2.zig
index d231c0d416..10b097e777 100644
--- a/lib/std/special/compiler_rt/truncXfYf2.zig
+++ b/lib/std/special/compiler_rt/truncXfYf2.zig
@@ -1,22 +1,22 @@
const std = @import("std");
-pub extern fn __truncsfhf2(a: f32) u16 {
+pub fn __truncsfhf2(a: f32) callconv(.C) u16 {
return @bitCast(u16, truncXfYf2(f16, f32, a));
}
-pub extern fn __truncdfhf2(a: f64) u16 {
+pub fn __truncdfhf2(a: f64) callconv(.C) u16 {
return @bitCast(u16, truncXfYf2(f16, f64, a));
}
-pub extern fn __trunctfsf2(a: f128) f32 {
+pub fn __trunctfsf2(a: f128) callconv(.C) f32 {
return truncXfYf2(f32, f128, a);
}
-pub extern fn __trunctfdf2(a: f128) f64 {
+pub fn __trunctfdf2(a: f128) callconv(.C) f64 {
return truncXfYf2(f64, f128, a);
}
-pub extern fn __truncdfsf2(a: f64) f32 {
+pub fn __truncdfsf2(a: f64) callconv(.C) f32 {
return truncXfYf2(f32, f64, a);
}
diff --git a/lib/std/special/compiler_rt/udivmoddi4.zig b/lib/std/special/compiler_rt/udivmoddi4.zig
index de86c845e5..79f0f39986 100644
--- a/lib/std/special/compiler_rt/udivmoddi4.zig
+++ b/lib/std/special/compiler_rt/udivmoddi4.zig
@@ -1,7 +1,7 @@
const udivmod = @import("udivmod.zig").udivmod;
const builtin = @import("builtin");
-pub extern fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?*u64) u64 {
+pub fn __udivmoddi4(a: u64, b: u64, maybe_rem: ?*u64) callconv(.C) u64 {
@setRuntimeSafety(builtin.is_test);
return udivmod(u64, a, b, maybe_rem);
}
diff --git a/lib/std/special/compiler_rt/udivmodti4.zig b/lib/std/special/compiler_rt/udivmodti4.zig
index c74dff512d..7a3405c3e2 100644
--- a/lib/std/special/compiler_rt/udivmodti4.zig
+++ b/lib/std/special/compiler_rt/udivmodti4.zig
@@ -2,13 +2,13 @@ const udivmod = @import("udivmod.zig").udivmod;
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __udivmodti4(a: u128, b: u128, maybe_rem: ?*u128) u128 {
+pub fn __udivmodti4(a: u128, b: u128, maybe_rem: ?*u128) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
return udivmod(u128, a, b, maybe_rem);
}
const v128 = @Vector(2, u64);
-pub extern fn __udivmodti4_windows_x86_64(a: v128, b: v128, maybe_rem: ?*u128) v128 {
+pub fn __udivmodti4_windows_x86_64(a: v128, b: v128, maybe_rem: ?*u128) callconv(.C) v128 {
@setRuntimeSafety(builtin.is_test);
return @bitCast(v128, udivmod(u128, @bitCast(u128, a), @bitCast(u128, b), maybe_rem));
}
diff --git a/lib/std/special/compiler_rt/udivti3.zig b/lib/std/special/compiler_rt/udivti3.zig
index ab451859bf..6283285e01 100644
--- a/lib/std/special/compiler_rt/udivti3.zig
+++ b/lib/std/special/compiler_rt/udivti3.zig
@@ -1,13 +1,13 @@
const udivmodti4 = @import("udivmodti4.zig");
const builtin = @import("builtin");
-pub extern fn __udivti3(a: u128, b: u128) u128 {
+pub fn __udivti3(a: u128, b: u128) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
return udivmodti4.__udivmodti4(a, b, null);
}
const v128 = @Vector(2, u64);
-pub extern fn __udivti3_windows_x86_64(a: v128, b: v128) v128 {
+pub fn __udivti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
@setRuntimeSafety(builtin.is_test);
return udivmodti4.__udivmodti4_windows_x86_64(a, b, null);
}
diff --git a/lib/std/special/compiler_rt/umodti3.zig b/lib/std/special/compiler_rt/umodti3.zig
index 9d4a42147c..4f9890f512 100644
--- a/lib/std/special/compiler_rt/umodti3.zig
+++ b/lib/std/special/compiler_rt/umodti3.zig
@@ -2,7 +2,7 @@ const udivmodti4 = @import("udivmodti4.zig");
const builtin = @import("builtin");
const compiler_rt = @import("../compiler_rt.zig");
-pub extern fn __umodti3(a: u128, b: u128) u128 {
+pub fn __umodti3(a: u128, b: u128) callconv(.C) u128 {
@setRuntimeSafety(builtin.is_test);
var r: u128 = undefined;
_ = udivmodti4.__udivmodti4(a, b, &r);
@@ -10,7 +10,7 @@ pub extern fn __umodti3(a: u128, b: u128) u128 {
}
const v128 = @Vector(2, u64);
-pub extern fn __umodti3_windows_x86_64(a: v128, b: v128) v128 {
+pub fn __umodti3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
return @bitCast(v128, @call(.{ .modifier = .always_inline }, __umodti3, .{
@bitCast(u128, a),
@bitCast(u128, b),