mach: add a standard way to access platform specific structs

This is done by adding platform.zig which is a file providing types like
``CoreType``, ``GpuDriverType`` and ``BackingTimerType``.
This commit is contained in:
iddev5 2022-05-23 13:23:26 +05:30 committed by Stephen Gutekanst
parent e5050e856e
commit f3e2b8b74c
5 changed files with 74 additions and 77 deletions

8
src/platform.zig Normal file
View file

@ -0,0 +1,8 @@
const builtin = @import("builtin");
const Platform = if (builtin.cpu.arch == .wasm32) @import("wasm.zig") else @import("native.zig");
// TODO: verify declarations and its signatures
pub const CoreType = Platform.Core;
pub const GpuDriverType = Platform.GpuDriver;
pub const BackingTimerType = Platform.BackingTimer;