| ... | @@ -12,6 +12,10 @@ const is_wasm = switch (builtin.arch) { | ... | @@ -12,6 +12,10 @@ const is_wasm = switch (builtin.arch) { |
| 12 | .wasm32, .wasm64 => true, | 12 | .wasm32, .wasm64 => true, |
| 13 | else => false, | 13 | else => false, |
| 14 | }; | 14 | }; |
| | 15 | const is_msvc = switch (builtin.abi) { |
| | 16 | .msvc => true, |
| | 17 | else => false, |
| | 18 | }; |
| 15 | const is_freestanding = switch (builtin.os) { | 19 | const is_freestanding = switch (builtin.os) { |
| 16 | .freestanding => true, | 20 | .freestanding => true, |
| 17 | else => false, | 21 | else => false, |
| ... | @@ -25,9 +29,13 @@ comptime { | ... | @@ -25,9 +29,13 @@ comptime { |
| 25 | @export("strncmp", strncmp, .Strong); | 29 | @export("strncmp", strncmp, .Strong); |
| 26 | @export("strerror", strerror, .Strong); | 30 | @export("strerror", strerror, .Strong); |
| 27 | @export("strlen", strlen, .Strong); | 31 | @export("strlen", strlen, .Strong); |
| | 32 | } else if (is_msvc) { |
| | 33 | @export("_fltused", _fltused, .Strong); |
| 28 | } | 34 | } |
| 29 | } | 35 | } |
| 30 | | 36 | |
| | 37 | extern var _fltused: c_int = 1; |
| | 38 | |
| 31 | extern fn main(argc: c_int, argv: [*][*]u8) c_int; | 39 | extern fn main(argc: c_int, argv: [*][*]u8) c_int; |
| 32 | extern fn wasm_start() void { | 40 | extern fn wasm_start() void { |
| 33 | _ = main(0, undefined); | 41 | _ = main(0, undefined); |