mirror of
https://github.com/ziglang/zig.git
synced 2026-01-21 06:45:24 +00:00
IR: update some std code to newest zig
This commit is contained in:
parent
83a668b9ca
commit
05b3b6a45e
@ -1,6 +1,6 @@
|
||||
const system = switch(@compileVar("os")) {
|
||||
linux => @import("linux.zig"),
|
||||
darwin => @import("darwin.zig"),
|
||||
Os.linux => @import("linux.zig"),
|
||||
Os.darwin => @import("darwin.zig"),
|
||||
else => @compileError("Unsupported OS"),
|
||||
};
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ pub fn max(x: var, y: var) -> @typeOf(x + y) {
|
||||
if (x > y) x else y
|
||||
}
|
||||
|
||||
pub error Overflow;
|
||||
error Overflow;
|
||||
pub fn mulOverflow(inline T: type, a: T, b: T) -> %T {
|
||||
var answer: T = undefined;
|
||||
if (@mulWithOverflow(T, a, b, &answer)) error.Overflow else answer
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user