sysaudio: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
72b081c97a
commit
7bc7caaec4
4 changed files with 17 additions and 4 deletions
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,11 @@ const SoundIoStream = union(Mode) {
|
|||
|
||||
const Audio = @This();
|
||||
|
||||
pub const DataCallback = fn (device: Device, frame_count: u32) void;
|
||||
pub const DataCallback = if (@import("builtin").zig_backend == .stage1)
|
||||
fn (device: Device, frame_count: u32) void
|
||||
else
|
||||
fn (device: Device, frame_count: u32) void;
|
||||
|
||||
pub const Device = struct {
|
||||
handle: SoundIoStream,
|
||||
data_callback: ?DataCallback = null,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue