mach: wasm: Add initial framework bones

This commit is contained in:
iddev5 2022-05-21 23:50:37 +05:30 committed by Stephen Gutekanst
parent 66cc8281e5
commit ccb1063e3f
3 changed files with 78 additions and 1 deletions

View file

@ -6,7 +6,29 @@ const Timer = @This();
backing_timer: BackingTimerType = undefined,
// TODO: verify declarations and its signatures
const BackingTimerType = if (builtin.cpu.arch == .wasm32) void else std.time.Timer;
const BackingTimerType = if (builtin.cpu.arch == .wasm32) struct {
pad0: u8 = 0,
const WasmTimer = @This();
fn start() !WasmTimer {
return WasmTimer{};
}
fn read(_: *WasmTimer) u64 {
return 0;
}
fn reset(_: *WasmTimer) void {}
fn lap(_: *WasmTimer) u64 {
return 0;
}
fn timeToNs(_: f64) u64 {
return 0;
}
} else std.time.Timer;
/// Initialize the timer.
pub fn start() !Timer {