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

@ -6,7 +6,10 @@ const ChannelLayout = @import("ChannelLayout.zig");
const InStream = @This();
pub const WriteCallback = fn (stream: ?[*]c.SoundIoInStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void;
pub const WriteCallback = if (@import("builtin").zig_backend == .stage1)
fn (stream: ?[*]c.SoundIoInStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void
else
*const fn (stream: ?[*]c.SoundIoInStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void;
handle: *c.SoundIoInStream,

View file

@ -6,7 +6,10 @@ const ChannelLayout = @import("ChannelLayout.zig");
const OutStream = @This();
pub const WriteCallback = fn (stream: ?[*]c.SoundIoOutStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void;
pub const WriteCallback = if (@import("builtin").zig_backend == .stage1)
fn (stream: ?[*]c.SoundIoOutStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void
else
*const fn (stream: ?[*]c.SoundIoOutStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void;
handle: *c.SoundIoOutStream,