sysaudio: improve compatibility with self-hosted compiler

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-20 11:41:15 -07:00
parent 72b081c97a
commit 7bc7caaec4
4 changed files with 17 additions and 4 deletions

View file

@ -5,7 +5,10 @@ const js = @import("sysjs");
const Audio = @This();
pub const DataCallback = fn (device: *Device, user_data: ?*anyopaque, sample: *f32) void;
pub const DataCallback = if (@import("builtin").zig_backend == .stage1)
fn (device: *Device, user_data: ?*anyopaque, sample: *f32) void
else
*const fn (device: *Device, user_data: ?*anyopaque, sample: *f32) void;
pub const Device = struct {
context: js.Object,