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:
parent
e5050e856e
commit
f3e2b8b74c
5 changed files with 74 additions and 77 deletions
8
src/platform.zig
Normal file
8
src/platform.zig
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue