mach: simplify sign function & improve self-hosted compiler support

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-27 11:57:41 -07:00 committed by Stephen Gutekanst
parent adfec5c930
commit 28fb75c7eb

View file

@ -232,10 +232,7 @@ pub const Platform = struct {
}
inline fn sign(val: f64) f64 {
return switch (val) {
0.0 => 0.0,
else => -val,
};
return if (val == 0.0) 0.0 else -val;
}
fn toMachButton(button: i32) enums.MouseButton {