diff --git a/README.md b/README.md index f6cf5ea4..302c9778 100644 --- a/README.md +++ b/README.md @@ -72,18 +72,16 @@ Mach is still early stages, so far we have support for building from the followi ## Supported Zig version -Zig has switched to the self-hosted compiler recently. This is a huge milestone, but currently means that Zig nightly versions are a little bit unstable. For now, we suggest using a slightly older Zig version before the switch to the self-hosted compiler. +Mach works with the new self-hosted Zig compiler only. This means you'll need to use the latest Zig nightly version. -Currently tested with: 0.10.0-dev.3952+9e070b653 - -You can download binary releases of this version at: +Currently we test using `0.10.0-dev.3952+9e070b653`. Newer is generally better, but you can download this version here: * **linux-x86_64**: https://ziglang.org/builds/zig-linux-x86_64-0.10.0-dev.3952+9e070b653.tar.xz) * **windows-x86_64**: https://ziglang.org/builds/zig-windows-x86_64-0.10.0-dev.3952+9e070b653.zip * **macos-x86_64** (Intel): https://ziglang.org/builds/zig-macos-x86_64-0.10.0-dev.3952+9e070b653.tar.xz * **macos-aarch64** (Apple Silicon): https://ziglang.org/builds/zig-macos-aarch64-0.10.0-dev.3952+9e070b653.tar.xz -You can subscribe to [issue #180](https://github.com/hexops/mach/issues/180) for how we're tracking towards support for the latest nightly version of Zig. +`mach/ecs` and WebAssembly examples have known issues unless using `-fstage1`, see [issue #180](https://github.com/hexops/mach/issues/180) for details. ## Contributing diff --git a/libs/ecs/build.zig b/libs/ecs/build.zig index 7ae35b84..f686c53a 100644 --- a/libs/ecs/build.zig +++ b/libs/ecs/build.zig @@ -9,10 +9,6 @@ pub fn build(b: *std.build.Builder) void { pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget) *std.build.RunStep { const main_tests = b.addTestExe("ecs-tests", (comptime thisDir()) ++ "/src/main.zig"); - - // TODO(self-hosted): remove this when tests passed with self-hosted compiler - main_tests.use_stage1 = true; - main_tests.setBuildMode(mode); main_tests.setTarget(target); main_tests.install(); diff --git a/libs/ecs/src/systems.zig b/libs/ecs/src/systems.zig index 0c64f5a3..f08e0bb2 100644 --- a/libs/ecs/src/systems.zig +++ b/libs/ecs/src/systems.zig @@ -47,6 +47,7 @@ pub fn Messages(comptime messages: anytype) type { }}; } + // TODO(self-hosted): check if we can remove this now // Hack to workaround stage1 compiler bug. https://github.com/ziglang/zig/issues/8114 // // return @Type(.{ diff --git a/libs/freetype/src/image.zig b/libs/freetype/src/image.zig index ed9069e6..d3a0d57e 100644 --- a/libs/freetype/src/image.zig +++ b/libs/freetype/src/image.zig @@ -14,10 +14,7 @@ const BBox = @import("types.zig").BBox; pub const Vector = c.FT_Vector; pub const GlyphMetrics = c.FT_Glyph_Metrics; pub const Span = c.FT_Span; -pub const SpanFunc = if (builtin.zig_backend == .stage1) - fn (y: c_int, count: c_int, spans: [*]const Span, user: *anyopaque) callconv(.C) void -else - *const fn (y: c_int, count: c_int, spans: [*]const Span, user: *anyopaque) callconv(.C) void; +pub const SpanFunc = *const fn (y: c_int, count: c_int, spans: [*]const Span, user: *anyopaque) callconv(.C) void; pub const PixelMode = enum(u3) { none = c.FT_PIXEL_MODE_NONE, @@ -204,10 +201,10 @@ pub const Outline = struct { pub fn Funcs(comptime Context: type) type { return struct { - move_to: if (builtin.zig_backend == .stage1 or builtin.zig_backend == .other) fn (ctx: Context, to: Vector) Error!void else *const fn (ctx: Context, to: Vector) Error!void, - line_to: if (builtin.zig_backend == .stage1 or builtin.zig_backend == .other) fn (ctx: Context, to: Vector) Error!void else *const fn (ctx: Context, to: Vector) Error!void, - conic_to: if (builtin.zig_backend == .stage1 or builtin.zig_backend == .other) fn (ctx: Context, control: Vector, to: Vector) Error!void else *const fn (ctx: Context, control: Vector, to: Vector) Error!void, - cubic_to: if (builtin.zig_backend == .stage1 or builtin.zig_backend == .other) fn (ctx: Context, control_0: Vector, control_1: Vector, to: Vector) Error!void else *const fn (ctx: Context, control_0: Vector, control_1: Vector, to: Vector) Error!void, + move_to: *const fn (ctx: Context, to: Vector) Error!void, + line_to: *const fn (ctx: Context, to: Vector) Error!void, + conic_to: *const fn (ctx: Context, control: Vector, to: Vector) Error!void, + cubic_to: *const fn (ctx: Context, control_0: Vector, control_1: Vector, to: Vector) Error!void, shift: i32, delta: i32, }; @@ -295,34 +292,13 @@ pub const Outline = struct { pub const Raster = struct { handle: c.FT_Raster, - pub const NewFunc = if (builtin.zig_backend == .stage1) - fn (memory: ?*anyopaque, raster: [*c]c.FT_Raster) callconv(.C) c_int - else - *const fn (memory: ?*anyopaque, raster: [*c]c.FT_Raster) callconv(.C) c_int; - pub const DoneFunc = if (builtin.zig_backend == .stage1) - fn (raster: [*c]c.FT_Raster) callconv(.C) void - else - *const fn (raster: [*c]c.FT_Raster) callconv(.C) void; - pub const ResetFunc = if (builtin.zig_backend == .stage1) - fn (raster: c.FT_Raster, pool_base: [*c]u8, pool_size: c_ulong) callconv(.C) void - else - *const fn (raster: c.FT_Raster, pool_base: [*c]u8, pool_size: c_ulong) callconv(.C) void; - pub const SetModeFunc = if (builtin.zig_backend == .stage1) - fn (raster: c.FT_Raster, mode: c_ulong, args: ?*anyopaque) callconv(.C) c_int - else - *const fn (raster: c.FT_Raster, mode: c_ulong, args: ?*anyopaque) callconv(.C) c_int; - pub const RenderFunc = if (builtin.zig_backend == .stage1) - fn (raster: c.FT_Raster, params: Params) callconv(.C) c_int - else - *const fn (raster: c.FT_Raster, params: Params) callconv(.C) c_int; - pub const BitTestFunc = if (builtin.zig_backend == .stage1) - fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) c_int - else - *const fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) c_int; - pub const BitSetFunc = if (builtin.zig_backend == .stage1) - fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) void - else - *const fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) void; + pub const NewFunc = *const fn (memory: ?*anyopaque, raster: [*c]c.FT_Raster) callconv(.C) c_int; + pub const DoneFunc = *const fn (raster: [*c]c.FT_Raster) callconv(.C) void; + pub const ResetFunc = *const fn (raster: c.FT_Raster, pool_base: [*c]u8, pool_size: c_ulong) callconv(.C) void; + pub const SetModeFunc = *const fn (raster: c.FT_Raster, mode: c_ulong, args: ?*anyopaque) callconv(.C) c_int; + pub const RenderFunc = *const fn (raster: c.FT_Raster, params: Params) callconv(.C) c_int; + pub const BitTestFunc = *const fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) c_int; + pub const BitSetFunc = *const fn (y: c_int, x: c_int, user: ?*anyopaque) callconv(.C) void; pub const Params = extern struct { target: [*c]const c.FT_Bitmap, diff --git a/libs/gamemode/gamemode.zig b/libs/gamemode/gamemode.zig index 4e6fdf2a..cf6ce63e 100644 --- a/libs/gamemode/gamemode.zig +++ b/libs/gamemode/gamemode.zig @@ -1,10 +1,7 @@ //! Note: All the above requests can be blocking - dbus requests can and will block while the daemon //! handles the request. It is not recommended to make these calls in performance critical code const builtin = @import("builtin"); -pub const c = if (builtin.zig_backend == .stage1) - @import("gamemode_client_stage1.zig") -else - @import("gamemode_client.zig"); +pub const c = @import("gamemode_client.zig"); pub const GamemodeError = error{ RequestFailed, diff --git a/libs/gamemode/gamemode_client_stage1.zig b/libs/gamemode/gamemode_client_stage1.zig deleted file mode 100644 index 099089cb..00000000 --- a/libs/gamemode/gamemode_client_stage1.zig +++ /dev/null @@ -1,1650 +0,0 @@ -pub const __builtin_bswap16 = @import("std").zig.c_builtins.__builtin_bswap16; -pub const __builtin_bswap32 = @import("std").zig.c_builtins.__builtin_bswap32; -pub const __builtin_bswap64 = @import("std").zig.c_builtins.__builtin_bswap64; -pub const __builtin_signbit = @import("std").zig.c_builtins.__builtin_signbit; -pub const __builtin_signbitf = @import("std").zig.c_builtins.__builtin_signbitf; -pub const __builtin_popcount = @import("std").zig.c_builtins.__builtin_popcount; -pub const __builtin_ctz = @import("std").zig.c_builtins.__builtin_ctz; -pub const __builtin_clz = @import("std").zig.c_builtins.__builtin_clz; -pub const __builtin_sqrt = @import("std").zig.c_builtins.__builtin_sqrt; -pub const __builtin_sqrtf = @import("std").zig.c_builtins.__builtin_sqrtf; -pub const __builtin_sin = @import("std").zig.c_builtins.__builtin_sin; -pub const __builtin_sinf = @import("std").zig.c_builtins.__builtin_sinf; -pub const __builtin_cos = @import("std").zig.c_builtins.__builtin_cos; -pub const __builtin_cosf = @import("std").zig.c_builtins.__builtin_cosf; -pub const __builtin_exp = @import("std").zig.c_builtins.__builtin_exp; -pub const __builtin_expf = @import("std").zig.c_builtins.__builtin_expf; -pub const __builtin_exp2 = @import("std").zig.c_builtins.__builtin_exp2; -pub const __builtin_exp2f = @import("std").zig.c_builtins.__builtin_exp2f; -pub const __builtin_log = @import("std").zig.c_builtins.__builtin_log; -pub const __builtin_logf = @import("std").zig.c_builtins.__builtin_logf; -pub const __builtin_log2 = @import("std").zig.c_builtins.__builtin_log2; -pub const __builtin_log2f = @import("std").zig.c_builtins.__builtin_log2f; -pub const __builtin_log10 = @import("std").zig.c_builtins.__builtin_log10; -pub const __builtin_log10f = @import("std").zig.c_builtins.__builtin_log10f; -pub const __builtin_abs = @import("std").zig.c_builtins.__builtin_abs; -pub const __builtin_fabs = @import("std").zig.c_builtins.__builtin_fabs; -pub const __builtin_fabsf = @import("std").zig.c_builtins.__builtin_fabsf; -pub const __builtin_floor = @import("std").zig.c_builtins.__builtin_floor; -pub const __builtin_floorf = @import("std").zig.c_builtins.__builtin_floorf; -pub const __builtin_ceil = @import("std").zig.c_builtins.__builtin_ceil; -pub const __builtin_ceilf = @import("std").zig.c_builtins.__builtin_ceilf; -pub const __builtin_trunc = @import("std").zig.c_builtins.__builtin_trunc; -pub const __builtin_truncf = @import("std").zig.c_builtins.__builtin_truncf; -pub const __builtin_round = @import("std").zig.c_builtins.__builtin_round; -pub const __builtin_roundf = @import("std").zig.c_builtins.__builtin_roundf; -pub const __builtin_strlen = @import("std").zig.c_builtins.__builtin_strlen; -pub const __builtin_strcmp = @import("std").zig.c_builtins.__builtin_strcmp; -pub const __builtin_object_size = @import("std").zig.c_builtins.__builtin_object_size; -pub const __builtin___memset_chk = @import("std").zig.c_builtins.__builtin___memset_chk; -pub const __builtin_memset = @import("std").zig.c_builtins.__builtin_memset; -pub const __builtin___memcpy_chk = @import("std").zig.c_builtins.__builtin___memcpy_chk; -pub const __builtin_memcpy = @import("std").zig.c_builtins.__builtin_memcpy; -pub const __builtin_expect = @import("std").zig.c_builtins.__builtin_expect; -pub const __builtin_nanf = @import("std").zig.c_builtins.__builtin_nanf; -pub const __builtin_huge_valf = @import("std").zig.c_builtins.__builtin_huge_valf; -pub const __builtin_inff = @import("std").zig.c_builtins.__builtin_inff; -pub const __builtin_isnan = @import("std").zig.c_builtins.__builtin_isnan; -pub const __builtin_isinf = @import("std").zig.c_builtins.__builtin_isinf; -pub const __builtin_isinf_sign = @import("std").zig.c_builtins.__builtin_isinf_sign; -pub const __has_builtin = @import("std").zig.c_builtins.__has_builtin; -pub const __builtin_assume = @import("std").zig.c_builtins.__builtin_assume; -pub const __builtin_unreachable = @import("std").zig.c_builtins.__builtin_unreachable; -pub const __builtin_constant_p = @import("std").zig.c_builtins.__builtin_constant_p; -pub const __builtin_mul_overflow = @import("std").zig.c_builtins.__builtin_mul_overflow; -pub const struct___va_list_tag = extern struct { - gp_offset: c_uint, - fp_offset: c_uint, - overflow_arg_area: ?*anyopaque, - reg_save_area: ?*anyopaque, -}; -pub const __builtin_va_list = [1]struct___va_list_tag; -pub const va_list = __builtin_va_list; -pub const __gnuc_va_list = __builtin_va_list; -pub const __u_char = u8; -pub const __u_short = c_ushort; -pub const __u_int = c_uint; -pub const __u_long = c_ulong; -pub const __int8_t = i8; -pub const __uint8_t = u8; -pub const __int16_t = c_short; -pub const __uint16_t = c_ushort; -pub const __int32_t = c_int; -pub const __uint32_t = c_uint; -pub const __int64_t = c_long; -pub const __uint64_t = c_ulong; -pub const __int_least8_t = __int8_t; -pub const __uint_least8_t = __uint8_t; -pub const __int_least16_t = __int16_t; -pub const __uint_least16_t = __uint16_t; -pub const __int_least32_t = __int32_t; -pub const __uint_least32_t = __uint32_t; -pub const __int_least64_t = __int64_t; -pub const __uint_least64_t = __uint64_t; -pub const __quad_t = c_long; -pub const __u_quad_t = c_ulong; -pub const __intmax_t = c_long; -pub const __uintmax_t = c_ulong; -pub const __dev_t = c_ulong; -pub const __uid_t = c_uint; -pub const __gid_t = c_uint; -pub const __ino_t = c_ulong; -pub const __ino64_t = c_ulong; -pub const __mode_t = c_uint; -pub const __nlink_t = c_ulong; -pub const __off_t = c_long; -pub const __off64_t = c_long; -pub const __pid_t = c_int; -pub const __fsid_t = extern struct { - __val: [2]c_int, -}; -pub const __clock_t = c_long; -pub const __rlim_t = c_ulong; -pub const __rlim64_t = c_ulong; -pub const __id_t = c_uint; -pub const __time_t = c_long; -pub const __useconds_t = c_uint; -pub const __suseconds_t = c_long; -pub const __suseconds64_t = c_long; -pub const __daddr_t = c_int; -pub const __key_t = c_int; -pub const __clockid_t = c_int; -pub const __timer_t = ?*anyopaque; -pub const __blksize_t = c_long; -pub const __blkcnt_t = c_long; -pub const __blkcnt64_t = c_long; -pub const __fsblkcnt_t = c_ulong; -pub const __fsblkcnt64_t = c_ulong; -pub const __fsfilcnt_t = c_ulong; -pub const __fsfilcnt64_t = c_ulong; -pub const __fsword_t = c_long; -pub const __ssize_t = c_long; -pub const __syscall_slong_t = c_long; -pub const __syscall_ulong_t = c_ulong; -pub const __loff_t = __off64_t; -pub const __caddr_t = [*c]u8; -pub const __intptr_t = c_long; -pub const __socklen_t = c_uint; -pub const __sig_atomic_t = c_int; -const union_unnamed_1 = extern union { - __wch: c_uint, - __wchb: [4]u8, -}; -pub const __mbstate_t = extern struct { - __count: c_int, - __value: union_unnamed_1, -}; -pub const struct__G_fpos_t = extern struct { - __pos: __off_t, - __state: __mbstate_t, -}; -pub const __fpos_t = struct__G_fpos_t; -pub const struct__G_fpos64_t = extern struct { - __pos: __off64_t, - __state: __mbstate_t, -}; -pub const __fpos64_t = struct__G_fpos64_t; -pub const struct__IO_marker = opaque {}; -pub const _IO_lock_t = anyopaque; -pub const struct__IO_codecvt = opaque {}; -pub const struct__IO_wide_data = opaque {}; -pub const struct__IO_FILE = extern struct { - _flags: c_int, - _IO_read_ptr: [*c]u8, - _IO_read_end: [*c]u8, - _IO_read_base: [*c]u8, - _IO_write_base: [*c]u8, - _IO_write_ptr: [*c]u8, - _IO_write_end: [*c]u8, - _IO_buf_base: [*c]u8, - _IO_buf_end: [*c]u8, - _IO_save_base: [*c]u8, - _IO_backup_base: [*c]u8, - _IO_save_end: [*c]u8, - _markers: ?*struct__IO_marker, - _chain: [*c]struct__IO_FILE, - _fileno: c_int, - _flags2: c_int, - _old_offset: __off_t, - _cur_column: c_ushort, - _vtable_offset: i8, - _shortbuf: [1]u8, - _lock: ?*_IO_lock_t, - _offset: __off64_t, - _codecvt: ?*struct__IO_codecvt, - _wide_data: ?*struct__IO_wide_data, - _freeres_list: [*c]struct__IO_FILE, - _freeres_buf: ?*anyopaque, - __pad5: usize, - _mode: c_int, - _unused2: [20]u8, -}; -pub const __FILE = struct__IO_FILE; -pub const FILE = struct__IO_FILE; -pub const off_t = __off_t; -pub const fpos_t = __fpos_t; -pub extern var stdin: [*c]FILE; -pub extern var stdout: [*c]FILE; -pub extern var stderr: [*c]FILE; -pub extern fn remove(__filename: [*c]const u8) c_int; -pub extern fn rename(__old: [*c]const u8, __new: [*c]const u8) c_int; -pub extern fn renameat(__oldfd: c_int, __old: [*c]const u8, __newfd: c_int, __new: [*c]const u8) c_int; -pub extern fn fclose(__stream: [*c]FILE) c_int; -pub extern fn tmpfile() [*c]FILE; -pub extern fn tmpnam([*c]u8) [*c]u8; -pub extern fn tmpnam_r(__s: [*c]u8) [*c]u8; -pub extern fn tempnam(__dir: [*c]const u8, __pfx: [*c]const u8) [*c]u8; -pub extern fn fflush(__stream: [*c]FILE) c_int; -pub extern fn fflush_unlocked(__stream: [*c]FILE) c_int; -pub extern fn fopen(__filename: [*c]const u8, __modes: [*c]const u8) [*c]FILE; -pub extern fn freopen(noalias __filename: [*c]const u8, noalias __modes: [*c]const u8, noalias __stream: [*c]FILE) [*c]FILE; -pub extern fn fdopen(__fd: c_int, __modes: [*c]const u8) [*c]FILE; -pub extern fn fmemopen(__s: ?*anyopaque, __len: usize, __modes: [*c]const u8) [*c]FILE; -pub extern fn open_memstream(__bufloc: [*c][*c]u8, __sizeloc: [*c]usize) [*c]FILE; -pub extern fn setbuf(noalias __stream: [*c]FILE, noalias __buf: [*c]u8) void; -pub extern fn setvbuf(noalias __stream: [*c]FILE, noalias __buf: [*c]u8, __modes: c_int, __n: usize) c_int; -pub extern fn setbuffer(noalias __stream: [*c]FILE, noalias __buf: [*c]u8, __size: usize) void; -pub extern fn setlinebuf(__stream: [*c]FILE) void; -pub extern fn fprintf(__stream: [*c]FILE, __format: [*c]const u8, ...) c_int; -pub extern fn printf(__format: [*c]const u8, ...) c_int; -pub extern fn sprintf(__s: [*c]u8, __format: [*c]const u8, ...) c_int; -pub extern fn vfprintf(__s: [*c]FILE, __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn vprintf(__format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn vsprintf(__s: [*c]u8, __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn snprintf(__s: [*c]u8, __maxlen: c_ulong, __format: [*c]const u8, ...) c_int; -pub extern fn vsnprintf(__s: [*c]u8, __maxlen: c_ulong, __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn vdprintf(__fd: c_int, noalias __fmt: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn dprintf(__fd: c_int, noalias __fmt: [*c]const u8, ...) c_int; -pub extern fn fscanf(noalias __stream: [*c]FILE, noalias __format: [*c]const u8, ...) c_int; -pub extern fn scanf(noalias __format: [*c]const u8, ...) c_int; -pub extern fn sscanf(noalias __s: [*c]const u8, noalias __format: [*c]const u8, ...) c_int; -pub const _Float32 = f32; -pub const _Float64 = f64; -pub const _Float32x = f64; -pub const _Float64x = c_longdouble; -pub extern fn vfscanf(noalias __s: [*c]FILE, noalias __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn vscanf(noalias __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn vsscanf(noalias __s: [*c]const u8, noalias __format: [*c]const u8, __arg: [*c]struct___va_list_tag) c_int; -pub extern fn fgetc(__stream: [*c]FILE) c_int; -pub extern fn getc(__stream: [*c]FILE) c_int; -pub extern fn getchar() c_int; -pub extern fn getc_unlocked(__stream: [*c]FILE) c_int; -pub extern fn getchar_unlocked() c_int; -pub extern fn fgetc_unlocked(__stream: [*c]FILE) c_int; -pub extern fn fputc(__c: c_int, __stream: [*c]FILE) c_int; -pub extern fn putc(__c: c_int, __stream: [*c]FILE) c_int; -pub extern fn putchar(__c: c_int) c_int; -pub extern fn fputc_unlocked(__c: c_int, __stream: [*c]FILE) c_int; -pub extern fn putc_unlocked(__c: c_int, __stream: [*c]FILE) c_int; -pub extern fn putchar_unlocked(__c: c_int) c_int; -pub extern fn getw(__stream: [*c]FILE) c_int; -pub extern fn putw(__w: c_int, __stream: [*c]FILE) c_int; -pub extern fn fgets(noalias __s: [*c]u8, __n: c_int, noalias __stream: [*c]FILE) [*c]u8; -pub extern fn __getdelim(noalias __lineptr: [*c][*c]u8, noalias __n: [*c]usize, __delimiter: c_int, noalias __stream: [*c]FILE) __ssize_t; -pub extern fn getdelim(noalias __lineptr: [*c][*c]u8, noalias __n: [*c]usize, __delimiter: c_int, noalias __stream: [*c]FILE) __ssize_t; -pub extern fn getline(noalias __lineptr: [*c][*c]u8, noalias __n: [*c]usize, noalias __stream: [*c]FILE) __ssize_t; -pub extern fn fputs(noalias __s: [*c]const u8, noalias __stream: [*c]FILE) c_int; -pub extern fn puts(__s: [*c]const u8) c_int; -pub extern fn ungetc(__c: c_int, __stream: [*c]FILE) c_int; -pub extern fn fread(__ptr: ?*anyopaque, __size: c_ulong, __n: c_ulong, __stream: [*c]FILE) c_ulong; -pub extern fn fwrite(__ptr: ?*const anyopaque, __size: c_ulong, __n: c_ulong, __s: [*c]FILE) c_ulong; -pub extern fn fread_unlocked(noalias __ptr: ?*anyopaque, __size: usize, __n: usize, noalias __stream: [*c]FILE) usize; -pub extern fn fwrite_unlocked(noalias __ptr: ?*const anyopaque, __size: usize, __n: usize, noalias __stream: [*c]FILE) usize; -pub extern fn fseek(__stream: [*c]FILE, __off: c_long, __whence: c_int) c_int; -pub extern fn ftell(__stream: [*c]FILE) c_long; -pub extern fn rewind(__stream: [*c]FILE) void; -pub extern fn fseeko(__stream: [*c]FILE, __off: __off_t, __whence: c_int) c_int; -pub extern fn ftello(__stream: [*c]FILE) __off_t; -pub extern fn fgetpos(noalias __stream: [*c]FILE, noalias __pos: [*c]fpos_t) c_int; -pub extern fn fsetpos(__stream: [*c]FILE, __pos: [*c]const fpos_t) c_int; -pub extern fn clearerr(__stream: [*c]FILE) void; -pub extern fn feof(__stream: [*c]FILE) c_int; -pub extern fn ferror(__stream: [*c]FILE) c_int; -pub extern fn clearerr_unlocked(__stream: [*c]FILE) void; -pub extern fn feof_unlocked(__stream: [*c]FILE) c_int; -pub extern fn ferror_unlocked(__stream: [*c]FILE) c_int; -pub extern fn perror(__s: [*c]const u8) void; -pub extern fn fileno(__stream: [*c]FILE) c_int; -pub extern fn fileno_unlocked(__stream: [*c]FILE) c_int; -pub extern fn pclose(__stream: [*c]FILE) c_int; -pub extern fn popen(__command: [*c]const u8, __modes: [*c]const u8) [*c]FILE; -pub extern fn ctermid(__s: [*c]u8) [*c]u8; -pub extern fn flockfile(__stream: [*c]FILE) void; -pub extern fn ftrylockfile(__stream: [*c]FILE) c_int; -pub extern fn funlockfile(__stream: [*c]FILE) void; -pub extern fn __uflow([*c]FILE) c_int; -pub extern fn __overflow([*c]FILE, c_int) c_int; -pub extern fn dlopen(__file: [*c]const u8, __mode: c_int) ?*anyopaque; -pub extern fn dlclose(__handle: ?*anyopaque) c_int; -pub extern fn dlsym(noalias __handle: ?*anyopaque, noalias __name: [*c]const u8) ?*anyopaque; -pub extern fn dlerror() [*c]u8; -pub extern fn memcpy(__dest: ?*anyopaque, __src: ?*const anyopaque, __n: c_ulong) ?*anyopaque; -pub extern fn memmove(__dest: ?*anyopaque, __src: ?*const anyopaque, __n: c_ulong) ?*anyopaque; -pub extern fn memccpy(__dest: ?*anyopaque, __src: ?*const anyopaque, __c: c_int, __n: c_ulong) ?*anyopaque; -pub extern fn memset(__s: ?*anyopaque, __c: c_int, __n: c_ulong) ?*anyopaque; -pub extern fn memcmp(__s1: ?*const anyopaque, __s2: ?*const anyopaque, __n: c_ulong) c_int; -pub extern fn memchr(__s: ?*const anyopaque, __c: c_int, __n: c_ulong) ?*anyopaque; -pub extern fn strcpy(__dest: [*c]u8, __src: [*c]const u8) [*c]u8; -pub extern fn strncpy(__dest: [*c]u8, __src: [*c]const u8, __n: c_ulong) [*c]u8; -pub extern fn strcat(__dest: [*c]u8, __src: [*c]const u8) [*c]u8; -pub extern fn strncat(__dest: [*c]u8, __src: [*c]const u8, __n: c_ulong) [*c]u8; -pub extern fn strcmp(__s1: [*c]const u8, __s2: [*c]const u8) c_int; -pub extern fn strncmp(__s1: [*c]const u8, __s2: [*c]const u8, __n: c_ulong) c_int; -pub extern fn strcoll(__s1: [*c]const u8, __s2: [*c]const u8) c_int; -pub extern fn strxfrm(__dest: [*c]u8, __src: [*c]const u8, __n: c_ulong) c_ulong; -pub const struct___locale_data = opaque {}; -pub const struct___locale_struct = extern struct { - __locales: [13]?*struct___locale_data, - __ctype_b: [*c]const c_ushort, - __ctype_tolower: [*c]const c_int, - __ctype_toupper: [*c]const c_int, - __names: [13][*c]const u8, -}; -pub const __locale_t = [*c]struct___locale_struct; -pub const locale_t = __locale_t; -pub extern fn strcoll_l(__s1: [*c]const u8, __s2: [*c]const u8, __l: locale_t) c_int; -pub extern fn strxfrm_l(__dest: [*c]u8, __src: [*c]const u8, __n: usize, __l: locale_t) usize; -pub extern fn strdup(__s: [*c]const u8) [*c]u8; -pub extern fn strndup(__string: [*c]const u8, __n: c_ulong) [*c]u8; -pub extern fn strchr(__s: [*c]const u8, __c: c_int) [*c]u8; -pub extern fn strrchr(__s: [*c]const u8, __c: c_int) [*c]u8; -pub extern fn strcspn(__s: [*c]const u8, __reject: [*c]const u8) c_ulong; -pub extern fn strspn(__s: [*c]const u8, __accept: [*c]const u8) c_ulong; -pub extern fn strpbrk(__s: [*c]const u8, __accept: [*c]const u8) [*c]u8; -pub extern fn strstr(__haystack: [*c]const u8, __needle: [*c]const u8) [*c]u8; -pub extern fn strtok(__s: [*c]u8, __delim: [*c]const u8) [*c]u8; -pub extern fn __strtok_r(noalias __s: [*c]u8, noalias __delim: [*c]const u8, noalias __save_ptr: [*c][*c]u8) [*c]u8; -pub extern fn strtok_r(noalias __s: [*c]u8, noalias __delim: [*c]const u8, noalias __save_ptr: [*c][*c]u8) [*c]u8; -pub extern fn strlen(__s: [*c]const u8) c_ulong; -pub extern fn strnlen(__string: [*c]const u8, __maxlen: usize) usize; -pub extern fn strerror(__errnum: c_int) [*c]u8; -pub extern fn strerror_r(__errnum: c_int, __buf: [*c]u8, __buflen: usize) c_int; -pub extern fn strerror_l(__errnum: c_int, __l: locale_t) [*c]u8; -pub extern fn bcmp(__s1: ?*const anyopaque, __s2: ?*const anyopaque, __n: c_ulong) c_int; -pub extern fn bcopy(__src: ?*const anyopaque, __dest: ?*anyopaque, __n: usize) void; -pub extern fn bzero(__s: ?*anyopaque, __n: c_ulong) void; -pub extern fn index(__s: [*c]const u8, __c: c_int) [*c]u8; -pub extern fn rindex(__s: [*c]const u8, __c: c_int) [*c]u8; -pub extern fn ffs(__i: c_int) c_int; -pub extern fn ffsl(__l: c_long) c_int; -pub extern fn ffsll(__ll: c_longlong) c_int; -pub extern fn strcasecmp(__s1: [*c]const u8, __s2: [*c]const u8) c_int; -pub extern fn strncasecmp(__s1: [*c]const u8, __s2: [*c]const u8, __n: c_ulong) c_int; -pub extern fn strcasecmp_l(__s1: [*c]const u8, __s2: [*c]const u8, __loc: locale_t) c_int; -pub extern fn strncasecmp_l(__s1: [*c]const u8, __s2: [*c]const u8, __n: usize, __loc: locale_t) c_int; -pub extern fn explicit_bzero(__s: ?*anyopaque, __n: usize) void; -pub extern fn strsep(noalias __stringp: [*c][*c]u8, noalias __delim: [*c]const u8) [*c]u8; -pub extern fn strsignal(__sig: c_int) [*c]u8; -pub extern fn __stpcpy(noalias __dest: [*c]u8, noalias __src: [*c]const u8) [*c]u8; -pub extern fn stpcpy(__dest: [*c]u8, __src: [*c]const u8) [*c]u8; -pub extern fn __stpncpy(noalias __dest: [*c]u8, noalias __src: [*c]const u8, __n: usize) [*c]u8; -pub extern fn stpncpy(__dest: [*c]u8, __src: [*c]const u8, __n: c_ulong) [*c]u8; -pub extern fn __assert_fail(__assertion: [*c]const u8, __file: [*c]const u8, __line: c_uint, __function: [*c]const u8) noreturn; -pub extern fn __assert_perror_fail(__errnum: c_int, __file: [*c]const u8, __line: c_uint, __function: [*c]const u8) noreturn; -pub extern fn __assert(__assertion: [*c]const u8, __file: [*c]const u8, __line: c_int) noreturn; -pub const u_char = __u_char; -pub const u_short = __u_short; -pub const u_int = __u_int; -pub const u_long = __u_long; -pub const quad_t = __quad_t; -pub const u_quad_t = __u_quad_t; -pub const fsid_t = __fsid_t; -pub const loff_t = __loff_t; -pub const ino_t = __ino_t; -pub const dev_t = __dev_t; -pub const gid_t = __gid_t; -pub const mode_t = __mode_t; -pub const nlink_t = __nlink_t; -pub const uid_t = __uid_t; -pub const pid_t = __pid_t; -pub const id_t = __id_t; -pub const daddr_t = __daddr_t; -pub const caddr_t = __caddr_t; -pub const key_t = __key_t; -pub const clock_t = __clock_t; -pub const clockid_t = __clockid_t; -pub const time_t = __time_t; -pub const timer_t = __timer_t; -pub const ulong = c_ulong; -pub const ushort = c_ushort; -pub const uint = c_uint; -pub const u_int8_t = __uint8_t; -pub const u_int16_t = __uint16_t; -pub const u_int32_t = __uint32_t; -pub const u_int64_t = __uint64_t; -pub const register_t = c_long; -pub fn __bswap_16(arg___bsx: __uint16_t) callconv(.C) __uint16_t { - var __bsx = arg___bsx; - return @bitCast(__uint16_t, @truncate(c_short, ((@bitCast(c_int, @as(c_uint, __bsx)) >> @intCast(@import("std").math.Log2Int(c_int), 8)) & @as(c_int, 255)) | ((@bitCast(c_int, @as(c_uint, __bsx)) & @as(c_int, 255)) << @intCast(@import("std").math.Log2Int(c_int), 8)))); -} -pub fn __bswap_32(arg___bsx: __uint32_t) callconv(.C) __uint32_t { - var __bsx = arg___bsx; - return ((((__bsx & @as(c_uint, 4278190080)) >> @intCast(@import("std").math.Log2Int(c_uint), 24)) | ((__bsx & @as(c_uint, 16711680)) >> @intCast(@import("std").math.Log2Int(c_uint), 8))) | ((__bsx & @as(c_uint, 65280)) << @intCast(@import("std").math.Log2Int(c_uint), 8))) | ((__bsx & @as(c_uint, 255)) << @intCast(@import("std").math.Log2Int(c_uint), 24)); -} -pub fn __bswap_64(arg___bsx: __uint64_t) callconv(.C) __uint64_t { - var __bsx = arg___bsx; - return @bitCast(__uint64_t, @truncate(c_ulong, ((((((((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 18374686479671623680)) >> @intCast(@import("std").math.Log2Int(c_ulonglong), 56)) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 71776119061217280)) >> @intCast(@import("std").math.Log2Int(c_ulonglong), 40))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 280375465082880)) >> @intCast(@import("std").math.Log2Int(c_ulonglong), 24))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 1095216660480)) >> @intCast(@import("std").math.Log2Int(c_ulonglong), 8))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 4278190080)) << @intCast(@import("std").math.Log2Int(c_ulonglong), 8))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 16711680)) << @intCast(@import("std").math.Log2Int(c_ulonglong), 24))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 65280)) << @intCast(@import("std").math.Log2Int(c_ulonglong), 40))) | ((@bitCast(c_ulonglong, @as(c_ulonglong, __bsx)) & @as(c_ulonglong, 255)) << @intCast(@import("std").math.Log2Int(c_ulonglong), 56)))); -} -pub fn __uint16_identity(arg___x: __uint16_t) callconv(.C) __uint16_t { - var __x = arg___x; - return __x; -} -pub fn __uint32_identity(arg___x: __uint32_t) callconv(.C) __uint32_t { - var __x = arg___x; - return __x; -} -pub fn __uint64_identity(arg___x: __uint64_t) callconv(.C) __uint64_t { - var __x = arg___x; - return __x; -} -pub const __sigset_t = extern struct { - __val: [16]c_ulong, -}; -pub const sigset_t = __sigset_t; -pub const struct_timeval = extern struct { - tv_sec: __time_t, - tv_usec: __suseconds_t, -}; -pub const struct_timespec = extern struct { - tv_sec: __time_t, - tv_nsec: __syscall_slong_t, -}; -pub const suseconds_t = __suseconds_t; -pub const __fd_mask = c_long; -pub const fd_set = extern struct { - __fds_bits: [16]__fd_mask, -}; -pub const fd_mask = __fd_mask; -pub extern fn select(__nfds: c_int, noalias __readfds: [*c]fd_set, noalias __writefds: [*c]fd_set, noalias __exceptfds: [*c]fd_set, noalias __timeout: [*c]struct_timeval) c_int; -pub extern fn pselect(__nfds: c_int, noalias __readfds: [*c]fd_set, noalias __writefds: [*c]fd_set, noalias __exceptfds: [*c]fd_set, noalias __timeout: [*c]const struct_timespec, noalias __sigmask: [*c]const __sigset_t) c_int; -pub const blksize_t = __blksize_t; -pub const blkcnt_t = __blkcnt_t; -pub const fsblkcnt_t = __fsblkcnt_t; -pub const fsfilcnt_t = __fsfilcnt_t; -pub const struct___pthread_internal_list = extern struct { - __prev: [*c]struct___pthread_internal_list, - __next: [*c]struct___pthread_internal_list, -}; -pub const __pthread_list_t = struct___pthread_internal_list; -pub const struct___pthread_internal_slist = extern struct { - __next: [*c]struct___pthread_internal_slist, -}; -pub const __pthread_slist_t = struct___pthread_internal_slist; -pub const struct___pthread_mutex_s = extern struct { - __lock: c_int, - __count: c_uint, - __owner: c_int, - __nusers: c_uint, - __kind: c_int, - __spins: c_short, - __elision: c_short, - __list: __pthread_list_t, -}; -pub const struct___pthread_rwlock_arch_t = extern struct { - __readers: c_uint, - __writers: c_uint, - __wrphase_futex: c_uint, - __writers_futex: c_uint, - __pad3: c_uint, - __pad4: c_uint, - __cur_writer: c_int, - __shared: c_int, - __rwelision: i8, - __pad1: [7]u8, - __pad2: c_ulong, - __flags: c_uint, -}; -const struct_unnamed_3 = extern struct { - __low: c_uint, - __high: c_uint, -}; -const union_unnamed_2 = extern union { - __wseq: c_ulonglong, - __wseq32: struct_unnamed_3, -}; -const struct_unnamed_5 = extern struct { - __low: c_uint, - __high: c_uint, -}; -const union_unnamed_4 = extern union { - __g1_start: c_ulonglong, - __g1_start32: struct_unnamed_5, -}; -pub const struct___pthread_cond_s = extern struct { - unnamed_0: union_unnamed_2, - unnamed_1: union_unnamed_4, - __g_refs: [2]c_uint, - __g_size: [2]c_uint, - __g1_orig_size: c_uint, - __wrefs: c_uint, - __g_signals: [2]c_uint, -}; -pub const __tss_t = c_uint; -pub const __thrd_t = c_ulong; -pub const __once_flag = extern struct { - __data: c_int, -}; -pub const pthread_t = c_ulong; -pub const pthread_mutexattr_t = extern union { - __size: [4]u8, - __align: c_int, -}; -pub const pthread_condattr_t = extern union { - __size: [4]u8, - __align: c_int, -}; -pub const pthread_key_t = c_uint; -pub const pthread_once_t = c_int; -pub const union_pthread_attr_t = extern union { - __size: [56]u8, - __align: c_long, -}; -pub const pthread_attr_t = union_pthread_attr_t; -pub const pthread_mutex_t = extern union { - __data: struct___pthread_mutex_s, - __size: [40]u8, - __align: c_long, -}; -pub const pthread_cond_t = extern union { - __data: struct___pthread_cond_s, - __size: [48]u8, - __align: c_longlong, -}; -pub const pthread_rwlock_t = extern union { - __data: struct___pthread_rwlock_arch_t, - __size: [56]u8, - __align: c_long, -}; -pub const pthread_rwlockattr_t = extern union { - __size: [8]u8, - __align: c_long, -}; -pub const pthread_spinlock_t = c_int; -pub const pthread_barrier_t = extern union { - __size: [32]u8, - __align: c_long, -}; -pub const pthread_barrierattr_t = extern union { - __size: [4]u8, - __align: c_int, -}; -pub var internal_gamemode_client_error_string: [512]u8 = [1]u8{ - 0, -} ++ [1]u8{0} ** 511; -pub var internal_libgamemode_loaded: c_int = 1; -pub const api_call_return_int = ?fn () callconv(.C) c_int; -pub const api_call_return_cstring = ?fn () callconv(.C) [*c]const u8; -pub const api_call_pid_return_int = ?fn (pid_t) callconv(.C) c_int; -pub var REAL_internal_gamemode_request_start: api_call_return_int = null; -pub var REAL_internal_gamemode_request_end: api_call_return_int = null; -pub var REAL_internal_gamemode_query_status: api_call_return_int = null; -pub var REAL_internal_gamemode_error_string: api_call_return_cstring = null; -pub var REAL_internal_gamemode_request_start_for: api_call_pid_return_int = null; -pub var REAL_internal_gamemode_request_end_for: api_call_pid_return_int = null; -pub var REAL_internal_gamemode_query_status_for: api_call_pid_return_int = null; -pub inline fn internal_bind_libgamemode_symbol(arg_handle: ?*anyopaque, arg_name: [*c]const u8, arg_out_func: [*c]?*anyopaque, arg_func_size: usize, arg_required: bool) c_int { - var handle = arg_handle; - var name = arg_name; - var out_func = arg_out_func; - var func_size = arg_func_size; - var required = arg_required; - var symbol_lookup: ?*anyopaque = @intToPtr(?*anyopaque, @as(c_int, 0)); - var dl_error: [*c]u8 = null; - symbol_lookup = dlsym(handle, name); - dl_error = dlerror(); - if ((@as(c_int, @boolToInt(required)) != 0) and ((dl_error != null) or !(symbol_lookup != null))) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "dlsym failed - %s", dl_error); - return -@as(c_int, 1); - } - _ = memcpy(@ptrCast(?*anyopaque, out_func), @ptrCast(?*const anyopaque, &symbol_lookup), func_size); - return 0; -} -pub inline fn internal_load_libgamemode() c_int { - if (internal_libgamemode_loaded != @as(c_int, 1)) { - return internal_libgamemode_loaded; - } - const struct_binding = extern struct { - name: [*c]const u8, - functor: [*c]?*anyopaque, - func_size: usize, - required: bool, - }; - var bindings: [7]struct_binding = [7]struct_binding{ - struct_binding{ - .name = "real_gamemode_request_start", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_request_start), - .func_size = @sizeOf(api_call_return_int), - .required = @as(c_int, 1) != 0, - }, - struct_binding{ - .name = "real_gamemode_request_end", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_request_end), - .func_size = @sizeOf(api_call_return_int), - .required = @as(c_int, 1) != 0, - }, - struct_binding{ - .name = "real_gamemode_query_status", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_query_status), - .func_size = @sizeOf(api_call_return_int), - .required = @as(c_int, 0) != 0, - }, - struct_binding{ - .name = "real_gamemode_error_string", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_error_string), - .func_size = @sizeOf(api_call_return_cstring), - .required = @as(c_int, 1) != 0, - }, - struct_binding{ - .name = "real_gamemode_request_start_for", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_request_start_for), - .func_size = @sizeOf(api_call_pid_return_int), - .required = @as(c_int, 0) != 0, - }, - struct_binding{ - .name = "real_gamemode_request_end_for", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_request_end_for), - .func_size = @sizeOf(api_call_pid_return_int), - .required = @as(c_int, 0) != 0, - }, - struct_binding{ - .name = "real_gamemode_query_status_for", - .functor = @ptrCast([*c]?*anyopaque, &REAL_internal_gamemode_query_status_for), - .func_size = @sizeOf(api_call_pid_return_int), - .required = @as(c_int, 0) != 0, - }, - }; - var libgamemode: ?*anyopaque = @intToPtr(?*anyopaque, @as(c_int, 0)); - libgamemode = dlopen("libgamemode.so.0", @as(c_int, 2)); - if (!(libgamemode != null)) { - libgamemode = dlopen("libgamemode.so", @as(c_int, 2)); - if (!(libgamemode != null)) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "dlopen failed - %s", dlerror()); - internal_libgamemode_loaded = -@as(c_int, 1); - return -@as(c_int, 1); - } - } - { - var i: usize = 0; - while (i < (@sizeOf([7]struct_binding) / @sizeOf(struct_binding))) : (i +%= 1) { - var binder: [*c]struct_binding = &bindings[i]; - if (internal_bind_libgamemode_symbol(libgamemode, binder.*.name, binder.*.functor, binder.*.func_size, binder.*.required) != 0) { - internal_libgamemode_loaded = -@as(c_int, 1); - return -@as(c_int, 1); - } - } - } - internal_libgamemode_loaded = 0; - return 0; -} -pub inline fn gamemode_error_string() [*c]const u8 { - if ((internal_load_libgamemode() < @as(c_int, 0)) or (@bitCast(c_int, @as(c_uint, internal_gamemode_client_error_string[@intCast(c_uint, @as(c_int, 0))])) != @as(c_int, '\x00'))) { - return @ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)); - } - _ = blk: { - _ = @sizeOf(c_int); - break :blk blk_1: { - break :blk_1 if (REAL_internal_gamemode_error_string != @ptrCast(api_call_return_cstring, @alignCast(@import("std").meta.alignment(fn () callconv(.C) [*c]const u8), @intToPtr(?*anyopaque, @as(c_int, 0))))) {} else { - __assert_fail("REAL_internal_gamemode_error_string != NULL", "./gamemode/gamemode_client.h", @bitCast(c_uint, @as(c_int, 237)), "const char *gamemode_error_string(void)"); - }; - }; - }; - return REAL_internal_gamemode_error_string.?(); -} -pub inline fn gamemode_request_start() c_int { - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - _ = blk: { - _ = @sizeOf(c_int); - break :blk blk_1: { - break :blk_1 if (REAL_internal_gamemode_request_start != @ptrCast(api_call_return_int, @alignCast(@import("std").meta.alignment(fn () callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) {} else { - __assert_fail("REAL_internal_gamemode_request_start != NULL", "./gamemode/gamemode_client.h", @bitCast(c_uint, @as(c_int, 263)), "int gamemode_request_start(void)"); - }; - }; - }; - if (REAL_internal_gamemode_request_start.?() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - return 0; -} -pub inline fn gamemode_request_end() c_int { - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - _ = blk: { - _ = @sizeOf(c_int); - break :blk blk_1: { - break :blk_1 if (REAL_internal_gamemode_request_end != @ptrCast(api_call_return_int, @alignCast(@import("std").meta.alignment(fn () callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) {} else { - __assert_fail("REAL_internal_gamemode_request_end != NULL", "./gamemode/gamemode_client.h", @bitCast(c_uint, @as(c_int, 292)), "int gamemode_request_end(void)"); - }; - }; - }; - if (REAL_internal_gamemode_request_end.?() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - return 0; -} -pub inline fn gamemode_query_status() c_int { - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - if (REAL_internal_gamemode_query_status == @ptrCast(api_call_return_int, @alignCast(@import("std").meta.alignment(fn () callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "gamemode_query_status missing (older host?)"); - return -@as(c_int, 1); - } - return REAL_internal_gamemode_query_status.?(); -} -pub inline fn gamemode_request_start_for(arg_pid: pid_t) c_int { - var pid = arg_pid; - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - if (REAL_internal_gamemode_request_start_for == @ptrCast(api_call_pid_return_int, @alignCast(@import("std").meta.alignment(fn (pid_t) callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "gamemode_request_start_for missing (older host?)"); - return -@as(c_int, 1); - } - return REAL_internal_gamemode_request_start_for.?(pid); -} -pub inline fn gamemode_request_end_for(arg_pid: pid_t) c_int { - var pid = arg_pid; - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - if (REAL_internal_gamemode_request_end_for == @ptrCast(api_call_pid_return_int, @alignCast(@import("std").meta.alignment(fn (pid_t) callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "gamemode_request_end_for missing (older host?)"); - return -@as(c_int, 1); - } - return REAL_internal_gamemode_request_end_for.?(pid); -} -pub inline fn gamemode_query_status_for(arg_pid: pid_t) c_int { - var pid = arg_pid; - if (internal_load_libgamemode() < @as(c_int, 0)) { - return -@as(c_int, 1); - } - if (REAL_internal_gamemode_query_status_for == @ptrCast(api_call_pid_return_int, @alignCast(@import("std").meta.alignment(fn (pid_t) callconv(.C) c_int), @intToPtr(?*anyopaque, @as(c_int, 0))))) { - _ = snprintf(@ptrCast([*c]u8, @alignCast(@import("std").meta.alignment(u8), &internal_gamemode_client_error_string)), @sizeOf([512]u8), "gamemode_query_status_for missing (older host?)"); - return -@as(c_int, 1); - } - return REAL_internal_gamemode_query_status_for.?(pid); -} -pub const __INTMAX_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `L`"); // (no file):80:9 -pub const __UINTMAX_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `UL`"); // (no file):86:9 -pub const __INT64_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `L`"); // (no file):169:9 -pub const __UINT32_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `U`"); // (no file):191:9 -pub const __UINT64_C_SUFFIX__ = @compileError("unable to translate macro: undefined identifier `UL`"); // (no file):199:9 -pub const __seg_gs = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // (no file):329:9 -pub const __seg_fs = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // (no file):330:9 -pub const __GLIBC_USE = @compileError("unable to translate macro: undefined identifier `__GLIBC_USE_`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/features.h:186:9 -pub const __glibc_has_attribute = @compileError("unable to translate macro: undefined identifier `__has_attribute`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:44:10 -pub const __glibc_has_extension = @compileError("unable to translate macro: undefined identifier `__has_extension`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:54:10 -pub const __THROW = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:78:11 -pub const __THROWNL = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:79:11 -pub const __NTH = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:80:11 -pub const __NTHNL = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:81:11 -pub const __CONCAT = @compileError("unable to translate C expr: unexpected token '##'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:123:9 -pub const __STRING = @compileError("unable to translate C expr: unexpected token '#'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:124:9 -pub const __warnattr = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:158:10 -pub const __errordecl = @compileError("unable to translate C expr: unexpected token 'extern'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:159:10 -pub const __flexarr = @compileError("unable to translate C expr: unexpected token '['"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:167:10 -pub const __REDIRECT = @compileError("unable to translate macro: undefined identifier `__asm__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:198:10 -pub const __REDIRECT_NTH = @compileError("unable to translate macro: undefined identifier `__asm__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:205:11 -pub const __REDIRECT_NTHNL = @compileError("unable to translate macro: undefined identifier `__asm__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:207:11 -pub const __ASMNAME2 = @compileError("unable to translate C expr: unexpected token 'Identifier'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:211:10 -pub const __attribute_malloc__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:232:10 -pub const __attribute_alloc_size__ = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:243:10 -pub const __attribute_pure__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:250:10 -pub const __attribute_const__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:257:10 -pub const __attribute_maybe_unused__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:263:10 -pub const __attribute_used__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:272:10 -pub const __attribute_noinline__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:273:10 -pub const __attribute_deprecated__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:281:10 -pub const __attribute_deprecated_msg__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:291:10 -pub const __attribute_format_arg__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:304:10 -pub const __attribute_format_strfmon__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:314:10 -pub const __nonnull = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:324:11 -pub const __returns_nonnull = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:337:10 -pub const __attribute_warn_unused_result__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:346:10 -pub const __always_inline = @compileError("unable to translate macro: undefined identifier `__inline`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:364:10 -pub const __attribute_artificial__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:373:10 -pub const __extern_inline = @compileError("unable to translate macro: undefined identifier `__inline`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:391:11 -pub const __extern_always_inline = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:392:11 -pub const __restrict_arr = @compileError("unable to translate macro: undefined identifier `__restrict`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:435:10 -pub const __attribute_copy__ = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:484:10 -pub const __LDBL_REDIR2_DECL = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:560:10 -pub const __LDBL_REDIR_DECL = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:561:10 -pub const __glibc_macro_warning1 = @compileError("unable to translate macro: undefined identifier `_Pragma`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:575:10 -pub const __glibc_macro_warning = @compileError("unable to translate macro: undefined identifier `GCC`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:576:10 -pub const __attr_access = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:612:11 -pub const __attr_access_none = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:613:11 -pub const __attr_dealloc = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:623:10 -pub const __attribute_returns_twice__ = @compileError("unable to translate macro: undefined identifier `__attribute__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/sys/cdefs.h:630:10 -pub const va_start = @compileError("unable to translate macro: undefined identifier `__builtin_va_start`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/include/stdarg.h:17:9 -pub const va_end = @compileError("unable to translate macro: undefined identifier `__builtin_va_end`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/include/stdarg.h:18:9 -pub const va_arg = @compileError("unable to translate macro: undefined identifier `__builtin_va_arg`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/include/stdarg.h:19:9 -pub const __va_copy = @compileError("unable to translate macro: undefined identifier `__builtin_va_copy`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/include/stdarg.h:24:9 -pub const va_copy = @compileError("unable to translate macro: undefined identifier `__builtin_va_copy`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/include/stdarg.h:27:9 -pub const __STD_TYPE = @compileError("unable to translate C expr: unexpected token 'typedef'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/types.h:137:10 -pub const __FSID_T_TYPE = @compileError("unable to translate macro: undefined identifier `__val`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/x86_64-linux-gnu/bits/typesizes.h:73:9 -pub const __getc_unlocked_body = @compileError("TODO postfix inc/dec expr"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/types/struct_FILE.h:102:9 -pub const __putc_unlocked_body = @compileError("TODO postfix inc/dec expr"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/types/struct_FILE.h:106:9 -pub const __CFLOAT32 = @compileError("unable to translate: TODO _Complex"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:149:12 -pub const __CFLOAT64 = @compileError("unable to translate: TODO _Complex"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:160:13 -pub const __CFLOAT32X = @compileError("unable to translate: TODO _Complex"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:169:12 -pub const __CFLOAT64X = @compileError("unable to translate: TODO _Complex"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:178:13 -pub const __builtin_nansf32 = @compileError("unable to translate macro: undefined identifier `__builtin_nansf`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:221:12 -pub const __builtin_huge_valf64 = @compileError("unable to translate macro: undefined identifier `__builtin_huge_val`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:255:13 -pub const __builtin_inff64 = @compileError("unable to translate macro: undefined identifier `__builtin_inf`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:256:13 -pub const __builtin_nanf64 = @compileError("unable to translate macro: undefined identifier `__builtin_nan`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:257:13 -pub const __builtin_nansf64 = @compileError("unable to translate macro: undefined identifier `__builtin_nans`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:258:13 -pub const __builtin_huge_valf32x = @compileError("unable to translate macro: undefined identifier `__builtin_huge_val`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:272:12 -pub const __builtin_inff32x = @compileError("unable to translate macro: undefined identifier `__builtin_inf`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:273:12 -pub const __builtin_nanf32x = @compileError("unable to translate macro: undefined identifier `__builtin_nan`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:274:12 -pub const __builtin_nansf32x = @compileError("unable to translate macro: undefined identifier `__builtin_nans`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:275:12 -pub const __builtin_huge_valf64x = @compileError("unable to translate macro: undefined identifier `__builtin_huge_vall`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:289:13 -pub const __builtin_inff64x = @compileError("unable to translate macro: undefined identifier `__builtin_infl`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:290:13 -pub const __builtin_nanf64x = @compileError("unable to translate macro: undefined identifier `__builtin_nanl`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:291:13 -pub const __builtin_nansf64x = @compileError("unable to translate macro: undefined identifier `__builtin_nansl`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/floatn-common.h:292:13 -pub const __ASSERT_VOID_CAST = @compileError("unable to translate C expr: unexpected token 'Eof'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/assert.h:40:10 -pub const assert = @compileError("unable to translate macro: undefined identifier `__extension__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/assert.h:104:11 -pub const __ASSERT_FUNCTION = @compileError("unable to translate macro: undefined identifier `__extension__`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/assert.h:126:12 -pub const static_assert = @compileError("unable to translate C expr: unexpected token '_Static_assert'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/assert.h:140:10 -pub const __FD_ZERO = @compileError("unable to translate macro: undefined identifier `__i`"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/select.h:25:9 -pub const __FD_SET = @compileError("unable to translate C expr: expected ')' instead got '|='"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/select.h:32:9 -pub const __FD_CLR = @compileError("unable to translate C expr: expected ')' instead got '&='"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/select.h:34:9 -pub const __PTHREAD_MUTEX_INITIALIZER = @compileError("unable to translate C expr: unexpected token '{'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/x86_64-linux-gnu/bits/struct_mutex.h:56:10 -pub const __PTHREAD_RWLOCK_ELISION_EXTRA = @compileError("unable to translate C expr: unexpected token '{'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/x86_64-linux-gnu/bits/struct_rwlock.h:40:11 -pub const __ONCE_FLAG_INIT = @compileError("unable to translate C expr: unexpected token '{'"); // /home/Zargio/zig/0.10.0-dev.3313+cff5d9c80/files/lib/libc/include/generic-glibc/bits/thread-shared-types.h:127:9 -pub const __llvm__ = @as(c_int, 1); -pub const __clang__ = @as(c_int, 1); -pub const __clang_major__ = @as(c_int, 14); -pub const __clang_minor__ = @as(c_int, 0); -pub const __clang_patchlevel__ = @as(c_int, 6); -pub const __clang_version__ = "14.0.6 (git@github.com:ziglang/zig-bootstrap.git dbc902054739800b8c1656dc1fb29571bba074b9)"; -pub const __GNUC__ = @as(c_int, 4); -pub const __GNUC_MINOR__ = @as(c_int, 2); -pub const __GNUC_PATCHLEVEL__ = @as(c_int, 1); -pub const __GXX_ABI_VERSION = @as(c_int, 1002); -pub const __ATOMIC_RELAXED = @as(c_int, 0); -pub const __ATOMIC_CONSUME = @as(c_int, 1); -pub const __ATOMIC_ACQUIRE = @as(c_int, 2); -pub const __ATOMIC_RELEASE = @as(c_int, 3); -pub const __ATOMIC_ACQ_REL = @as(c_int, 4); -pub const __ATOMIC_SEQ_CST = @as(c_int, 5); -pub const __OPENCL_MEMORY_SCOPE_WORK_ITEM = @as(c_int, 0); -pub const __OPENCL_MEMORY_SCOPE_WORK_GROUP = @as(c_int, 1); -pub const __OPENCL_MEMORY_SCOPE_DEVICE = @as(c_int, 2); -pub const __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES = @as(c_int, 3); -pub const __OPENCL_MEMORY_SCOPE_SUB_GROUP = @as(c_int, 4); -pub const __PRAGMA_REDEFINE_EXTNAME = @as(c_int, 1); -pub const __VERSION__ = "Clang 14.0.6 (git@github.com:ziglang/zig-bootstrap.git dbc902054739800b8c1656dc1fb29571bba074b9)"; -pub const __OBJC_BOOL_IS_BOOL = @as(c_int, 0); -pub const __CONSTANT_CFSTRINGS__ = @as(c_int, 1); -pub const __clang_literal_encoding__ = "UTF-8"; -pub const __clang_wide_literal_encoding__ = "UTF-32"; -pub const __ORDER_LITTLE_ENDIAN__ = @as(c_int, 1234); -pub const __ORDER_BIG_ENDIAN__ = @as(c_int, 4321); -pub const __ORDER_PDP_ENDIAN__ = @as(c_int, 3412); -pub const __BYTE_ORDER__ = __ORDER_LITTLE_ENDIAN__; -pub const __LITTLE_ENDIAN__ = @as(c_int, 1); -pub const _LP64 = @as(c_int, 1); -pub const __LP64__ = @as(c_int, 1); -pub const __CHAR_BIT__ = @as(c_int, 8); -pub const __BOOL_WIDTH__ = @as(c_int, 8); -pub const __SHRT_WIDTH__ = @as(c_int, 16); -pub const __INT_WIDTH__ = @as(c_int, 32); -pub const __LONG_WIDTH__ = @as(c_int, 64); -pub const __LLONG_WIDTH__ = @as(c_int, 64); -pub const __BITINT_MAXWIDTH__ = @as(c_int, 128); -pub const __SCHAR_MAX__ = @as(c_int, 127); -pub const __SHRT_MAX__ = @as(c_int, 32767); -pub const __INT_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __LONG_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __LONG_LONG_MAX__ = @as(c_longlong, 9223372036854775807); -pub const __WCHAR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __WCHAR_WIDTH__ = @as(c_int, 32); -pub const __WINT_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal); -pub const __WINT_WIDTH__ = @as(c_int, 32); -pub const __INTMAX_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __INTMAX_WIDTH__ = @as(c_int, 64); -pub const __SIZE_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __SIZE_WIDTH__ = @as(c_int, 64); -pub const __UINTMAX_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __UINTMAX_WIDTH__ = @as(c_int, 64); -pub const __PTRDIFF_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __PTRDIFF_WIDTH__ = @as(c_int, 64); -pub const __INTPTR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __INTPTR_WIDTH__ = @as(c_int, 64); -pub const __UINTPTR_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __UINTPTR_WIDTH__ = @as(c_int, 64); -pub const __SIZEOF_DOUBLE__ = @as(c_int, 8); -pub const __SIZEOF_FLOAT__ = @as(c_int, 4); -pub const __SIZEOF_INT__ = @as(c_int, 4); -pub const __SIZEOF_LONG__ = @as(c_int, 8); -pub const __SIZEOF_LONG_DOUBLE__ = @as(c_int, 16); -pub const __SIZEOF_LONG_LONG__ = @as(c_int, 8); -pub const __SIZEOF_POINTER__ = @as(c_int, 8); -pub const __SIZEOF_SHORT__ = @as(c_int, 2); -pub const __SIZEOF_PTRDIFF_T__ = @as(c_int, 8); -pub const __SIZEOF_SIZE_T__ = @as(c_int, 8); -pub const __SIZEOF_WCHAR_T__ = @as(c_int, 4); -pub const __SIZEOF_WINT_T__ = @as(c_int, 4); -pub const __SIZEOF_INT128__ = @as(c_int, 16); -pub const __INTMAX_TYPE__ = c_long; -pub const __INTMAX_FMTd__ = "ld"; -pub const __INTMAX_FMTi__ = "li"; -pub const __UINTMAX_TYPE__ = c_ulong; -pub const __UINTMAX_FMTo__ = "lo"; -pub const __UINTMAX_FMTu__ = "lu"; -pub const __UINTMAX_FMTx__ = "lx"; -pub const __UINTMAX_FMTX__ = "lX"; -pub const __PTRDIFF_TYPE__ = c_long; -pub const __PTRDIFF_FMTd__ = "ld"; -pub const __PTRDIFF_FMTi__ = "li"; -pub const __INTPTR_TYPE__ = c_long; -pub const __INTPTR_FMTd__ = "ld"; -pub const __INTPTR_FMTi__ = "li"; -pub const __SIZE_TYPE__ = c_ulong; -pub const __SIZE_FMTo__ = "lo"; -pub const __SIZE_FMTu__ = "lu"; -pub const __SIZE_FMTx__ = "lx"; -pub const __SIZE_FMTX__ = "lX"; -pub const __WCHAR_TYPE__ = c_int; -pub const __WINT_TYPE__ = c_uint; -pub const __SIG_ATOMIC_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __SIG_ATOMIC_WIDTH__ = @as(c_int, 32); -pub const __CHAR16_TYPE__ = c_ushort; -pub const __CHAR32_TYPE__ = c_uint; -pub const __UINTPTR_TYPE__ = c_ulong; -pub const __UINTPTR_FMTo__ = "lo"; -pub const __UINTPTR_FMTu__ = "lu"; -pub const __UINTPTR_FMTx__ = "lx"; -pub const __UINTPTR_FMTX__ = "lX"; -pub const __FLT_DENORM_MIN__ = @as(f32, 1.40129846e-45); -pub const __FLT_HAS_DENORM__ = @as(c_int, 1); -pub const __FLT_DIG__ = @as(c_int, 6); -pub const __FLT_DECIMAL_DIG__ = @as(c_int, 9); -pub const __FLT_EPSILON__ = @as(f32, 1.19209290e-7); -pub const __FLT_HAS_INFINITY__ = @as(c_int, 1); -pub const __FLT_HAS_QUIET_NAN__ = @as(c_int, 1); -pub const __FLT_MANT_DIG__ = @as(c_int, 24); -pub const __FLT_MAX_10_EXP__ = @as(c_int, 38); -pub const __FLT_MAX_EXP__ = @as(c_int, 128); -pub const __FLT_MAX__ = @as(f32, 3.40282347e+38); -pub const __FLT_MIN_10_EXP__ = -@as(c_int, 37); -pub const __FLT_MIN_EXP__ = -@as(c_int, 125); -pub const __FLT_MIN__ = @as(f32, 1.17549435e-38); -pub const __DBL_DENORM_MIN__ = 4.9406564584124654e-324; -pub const __DBL_HAS_DENORM__ = @as(c_int, 1); -pub const __DBL_DIG__ = @as(c_int, 15); -pub const __DBL_DECIMAL_DIG__ = @as(c_int, 17); -pub const __DBL_EPSILON__ = 2.2204460492503131e-16; -pub const __DBL_HAS_INFINITY__ = @as(c_int, 1); -pub const __DBL_HAS_QUIET_NAN__ = @as(c_int, 1); -pub const __DBL_MANT_DIG__ = @as(c_int, 53); -pub const __DBL_MAX_10_EXP__ = @as(c_int, 308); -pub const __DBL_MAX_EXP__ = @as(c_int, 1024); -pub const __DBL_MAX__ = 1.7976931348623157e+308; -pub const __DBL_MIN_10_EXP__ = -@as(c_int, 307); -pub const __DBL_MIN_EXP__ = -@as(c_int, 1021); -pub const __DBL_MIN__ = 2.2250738585072014e-308; -pub const __LDBL_DENORM_MIN__ = @as(c_longdouble, 3.64519953188247460253e-4951); -pub const __LDBL_HAS_DENORM__ = @as(c_int, 1); -pub const __LDBL_DIG__ = @as(c_int, 18); -pub const __LDBL_DECIMAL_DIG__ = @as(c_int, 21); -pub const __LDBL_EPSILON__ = @as(c_longdouble, 1.08420217248550443401e-19); -pub const __LDBL_HAS_INFINITY__ = @as(c_int, 1); -pub const __LDBL_HAS_QUIET_NAN__ = @as(c_int, 1); -pub const __LDBL_MANT_DIG__ = @as(c_int, 64); -pub const __LDBL_MAX_10_EXP__ = @as(c_int, 4932); -pub const __LDBL_MAX_EXP__ = @as(c_int, 16384); -pub const __LDBL_MAX__ = @as(c_longdouble, 1.18973149535723176502e+4932); -pub const __LDBL_MIN_10_EXP__ = -@as(c_int, 4931); -pub const __LDBL_MIN_EXP__ = -@as(c_int, 16381); -pub const __LDBL_MIN__ = @as(c_longdouble, 3.36210314311209350626e-4932); -pub const __POINTER_WIDTH__ = @as(c_int, 64); -pub const __BIGGEST_ALIGNMENT__ = @as(c_int, 16); -pub const __WINT_UNSIGNED__ = @as(c_int, 1); -pub const __INT8_TYPE__ = i8; -pub const __INT8_FMTd__ = "hhd"; -pub const __INT8_FMTi__ = "hhi"; -pub const __INT8_C_SUFFIX__ = ""; -pub const __INT16_TYPE__ = c_short; -pub const __INT16_FMTd__ = "hd"; -pub const __INT16_FMTi__ = "hi"; -pub const __INT16_C_SUFFIX__ = ""; -pub const __INT32_TYPE__ = c_int; -pub const __INT32_FMTd__ = "d"; -pub const __INT32_FMTi__ = "i"; -pub const __INT32_C_SUFFIX__ = ""; -pub const __INT64_TYPE__ = c_long; -pub const __INT64_FMTd__ = "ld"; -pub const __INT64_FMTi__ = "li"; -pub const __UINT8_TYPE__ = u8; -pub const __UINT8_FMTo__ = "hho"; -pub const __UINT8_FMTu__ = "hhu"; -pub const __UINT8_FMTx__ = "hhx"; -pub const __UINT8_FMTX__ = "hhX"; -pub const __UINT8_C_SUFFIX__ = ""; -pub const __UINT8_MAX__ = @as(c_int, 255); -pub const __INT8_MAX__ = @as(c_int, 127); -pub const __UINT16_TYPE__ = c_ushort; -pub const __UINT16_FMTo__ = "ho"; -pub const __UINT16_FMTu__ = "hu"; -pub const __UINT16_FMTx__ = "hx"; -pub const __UINT16_FMTX__ = "hX"; -pub const __UINT16_C_SUFFIX__ = ""; -pub const __UINT16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal); -pub const __INT16_MAX__ = @as(c_int, 32767); -pub const __UINT32_TYPE__ = c_uint; -pub const __UINT32_FMTo__ = "o"; -pub const __UINT32_FMTu__ = "u"; -pub const __UINT32_FMTx__ = "x"; -pub const __UINT32_FMTX__ = "X"; -pub const __UINT32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal); -pub const __INT32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __UINT64_TYPE__ = c_ulong; -pub const __UINT64_FMTo__ = "lo"; -pub const __UINT64_FMTu__ = "lu"; -pub const __UINT64_FMTx__ = "lx"; -pub const __UINT64_FMTX__ = "lX"; -pub const __UINT64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __INT64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __INT_LEAST8_TYPE__ = i8; -pub const __INT_LEAST8_MAX__ = @as(c_int, 127); -pub const __INT_LEAST8_WIDTH__ = @as(c_int, 8); -pub const __INT_LEAST8_FMTd__ = "hhd"; -pub const __INT_LEAST8_FMTi__ = "hhi"; -pub const __UINT_LEAST8_TYPE__ = u8; -pub const __UINT_LEAST8_MAX__ = @as(c_int, 255); -pub const __UINT_LEAST8_FMTo__ = "hho"; -pub const __UINT_LEAST8_FMTu__ = "hhu"; -pub const __UINT_LEAST8_FMTx__ = "hhx"; -pub const __UINT_LEAST8_FMTX__ = "hhX"; -pub const __INT_LEAST16_TYPE__ = c_short; -pub const __INT_LEAST16_MAX__ = @as(c_int, 32767); -pub const __INT_LEAST16_WIDTH__ = @as(c_int, 16); -pub const __INT_LEAST16_FMTd__ = "hd"; -pub const __INT_LEAST16_FMTi__ = "hi"; -pub const __UINT_LEAST16_TYPE__ = c_ushort; -pub const __UINT_LEAST16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal); -pub const __UINT_LEAST16_FMTo__ = "ho"; -pub const __UINT_LEAST16_FMTu__ = "hu"; -pub const __UINT_LEAST16_FMTx__ = "hx"; -pub const __UINT_LEAST16_FMTX__ = "hX"; -pub const __INT_LEAST32_TYPE__ = c_int; -pub const __INT_LEAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __INT_LEAST32_WIDTH__ = @as(c_int, 32); -pub const __INT_LEAST32_FMTd__ = "d"; -pub const __INT_LEAST32_FMTi__ = "i"; -pub const __UINT_LEAST32_TYPE__ = c_uint; -pub const __UINT_LEAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal); -pub const __UINT_LEAST32_FMTo__ = "o"; -pub const __UINT_LEAST32_FMTu__ = "u"; -pub const __UINT_LEAST32_FMTx__ = "x"; -pub const __UINT_LEAST32_FMTX__ = "X"; -pub const __INT_LEAST64_TYPE__ = c_long; -pub const __INT_LEAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __INT_LEAST64_WIDTH__ = @as(c_int, 64); -pub const __INT_LEAST64_FMTd__ = "ld"; -pub const __INT_LEAST64_FMTi__ = "li"; -pub const __UINT_LEAST64_TYPE__ = c_ulong; -pub const __UINT_LEAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __UINT_LEAST64_FMTo__ = "lo"; -pub const __UINT_LEAST64_FMTu__ = "lu"; -pub const __UINT_LEAST64_FMTx__ = "lx"; -pub const __UINT_LEAST64_FMTX__ = "lX"; -pub const __INT_FAST8_TYPE__ = i8; -pub const __INT_FAST8_MAX__ = @as(c_int, 127); -pub const __INT_FAST8_WIDTH__ = @as(c_int, 8); -pub const __INT_FAST8_FMTd__ = "hhd"; -pub const __INT_FAST8_FMTi__ = "hhi"; -pub const __UINT_FAST8_TYPE__ = u8; -pub const __UINT_FAST8_MAX__ = @as(c_int, 255); -pub const __UINT_FAST8_FMTo__ = "hho"; -pub const __UINT_FAST8_FMTu__ = "hhu"; -pub const __UINT_FAST8_FMTx__ = "hhx"; -pub const __UINT_FAST8_FMTX__ = "hhX"; -pub const __INT_FAST16_TYPE__ = c_short; -pub const __INT_FAST16_MAX__ = @as(c_int, 32767); -pub const __INT_FAST16_WIDTH__ = @as(c_int, 16); -pub const __INT_FAST16_FMTd__ = "hd"; -pub const __INT_FAST16_FMTi__ = "hi"; -pub const __UINT_FAST16_TYPE__ = c_ushort; -pub const __UINT_FAST16_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 65535, .decimal); -pub const __UINT_FAST16_FMTo__ = "ho"; -pub const __UINT_FAST16_FMTu__ = "hu"; -pub const __UINT_FAST16_FMTx__ = "hx"; -pub const __UINT_FAST16_FMTX__ = "hX"; -pub const __INT_FAST32_TYPE__ = c_int; -pub const __INT_FAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_int, 2147483647, .decimal); -pub const __INT_FAST32_WIDTH__ = @as(c_int, 32); -pub const __INT_FAST32_FMTd__ = "d"; -pub const __INT_FAST32_FMTi__ = "i"; -pub const __UINT_FAST32_TYPE__ = c_uint; -pub const __UINT_FAST32_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_uint, 4294967295, .decimal); -pub const __UINT_FAST32_FMTo__ = "o"; -pub const __UINT_FAST32_FMTu__ = "u"; -pub const __UINT_FAST32_FMTx__ = "x"; -pub const __UINT_FAST32_FMTX__ = "X"; -pub const __INT_FAST64_TYPE__ = c_long; -pub const __INT_FAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_long, 9223372036854775807, .decimal); -pub const __INT_FAST64_WIDTH__ = @as(c_int, 64); -pub const __INT_FAST64_FMTd__ = "ld"; -pub const __INT_FAST64_FMTi__ = "li"; -pub const __UINT_FAST64_TYPE__ = c_ulong; -pub const __UINT_FAST64_MAX__ = @import("std").zig.c_translation.promoteIntLiteral(c_ulong, 18446744073709551615, .decimal); -pub const __UINT_FAST64_FMTo__ = "lo"; -pub const __UINT_FAST64_FMTu__ = "lu"; -pub const __UINT_FAST64_FMTx__ = "lx"; -pub const __UINT_FAST64_FMTX__ = "lX"; -pub const __USER_LABEL_PREFIX__ = ""; -pub const __FINITE_MATH_ONLY__ = @as(c_int, 0); -pub const __GNUC_STDC_INLINE__ = @as(c_int, 1); -pub const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = @as(c_int, 1); -pub const __CLANG_ATOMIC_BOOL_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_CHAR_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_CHAR16_T_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_CHAR32_T_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_WCHAR_T_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_SHORT_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_INT_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_LONG_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_LLONG_LOCK_FREE = @as(c_int, 2); -pub const __CLANG_ATOMIC_POINTER_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_BOOL_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_CHAR_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_CHAR16_T_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_CHAR32_T_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_SHORT_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_INT_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_LONG_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_LLONG_LOCK_FREE = @as(c_int, 2); -pub const __GCC_ATOMIC_POINTER_LOCK_FREE = @as(c_int, 2); -pub const __NO_INLINE__ = @as(c_int, 1); -pub const __PIC__ = @as(c_int, 2); -pub const __pic__ = @as(c_int, 2); -pub const __FLT_EVAL_METHOD__ = @as(c_int, 0); -pub const __FLT_RADIX__ = @as(c_int, 2); -pub const __DECIMAL_DIG__ = __LDBL_DECIMAL_DIG__; -pub const __SSP_STRONG__ = @as(c_int, 2); -pub const __GCC_ASM_FLAG_OUTPUTS__ = @as(c_int, 1); -pub const __code_model_small__ = @as(c_int, 1); -pub const __amd64__ = @as(c_int, 1); -pub const __amd64 = @as(c_int, 1); -pub const __x86_64 = @as(c_int, 1); -pub const __x86_64__ = @as(c_int, 1); -pub const __SEG_GS = @as(c_int, 1); -pub const __SEG_FS = @as(c_int, 1); -pub const __znver1 = @as(c_int, 1); -pub const __znver1__ = @as(c_int, 1); -pub const __tune_znver1__ = @as(c_int, 1); -pub const __REGISTER_PREFIX__ = ""; -pub const __NO_MATH_INLINES = @as(c_int, 1); -pub const __AES__ = @as(c_int, 1); -pub const __PCLMUL__ = @as(c_int, 1); -pub const __LAHF_SAHF__ = @as(c_int, 1); -pub const __LZCNT__ = @as(c_int, 1); -pub const __RDRND__ = @as(c_int, 1); -pub const __FSGSBASE__ = @as(c_int, 1); -pub const __BMI__ = @as(c_int, 1); -pub const __BMI2__ = @as(c_int, 1); -pub const __POPCNT__ = @as(c_int, 1); -pub const __PRFCHW__ = @as(c_int, 1); -pub const __RDSEED__ = @as(c_int, 1); -pub const __ADX__ = @as(c_int, 1); -pub const __MWAITX__ = @as(c_int, 1); -pub const __MOVBE__ = @as(c_int, 1); -pub const __SSE4A__ = @as(c_int, 1); -pub const __FMA__ = @as(c_int, 1); -pub const __F16C__ = @as(c_int, 1); -pub const __SHA__ = @as(c_int, 1); -pub const __FXSR__ = @as(c_int, 1); -pub const __XSAVE__ = @as(c_int, 1); -pub const __XSAVEOPT__ = @as(c_int, 1); -pub const __XSAVEC__ = @as(c_int, 1); -pub const __XSAVES__ = @as(c_int, 1); -pub const __CLFLUSHOPT__ = @as(c_int, 1); -pub const __CLZERO__ = @as(c_int, 1); -pub const __CRC32__ = @as(c_int, 1); -pub const __AVX2__ = @as(c_int, 1); -pub const __AVX__ = @as(c_int, 1); -pub const __SSE4_2__ = @as(c_int, 1); -pub const __SSE4_1__ = @as(c_int, 1); -pub const __SSSE3__ = @as(c_int, 1); -pub const __SSE3__ = @as(c_int, 1); -pub const __SSE2__ = @as(c_int, 1); -pub const __SSE2_MATH__ = @as(c_int, 1); -pub const __SSE__ = @as(c_int, 1); -pub const __SSE_MATH__ = @as(c_int, 1); -pub const __MMX__ = @as(c_int, 1); -pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = @as(c_int, 1); -pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = @as(c_int, 1); -pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = @as(c_int, 1); -pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = @as(c_int, 1); -pub const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = @as(c_int, 1); -pub const __SIZEOF_FLOAT128__ = @as(c_int, 16); -pub const unix = @as(c_int, 1); -pub const __unix = @as(c_int, 1); -pub const __unix__ = @as(c_int, 1); -pub const linux = @as(c_int, 1); -pub const __linux = @as(c_int, 1); -pub const __linux__ = @as(c_int, 1); -pub const __ELF__ = @as(c_int, 1); -pub const __gnu_linux__ = @as(c_int, 1); -pub const __FLOAT128__ = @as(c_int, 1); -pub const __STDC__ = @as(c_int, 1); -pub const __STDC_HOSTED__ = @as(c_int, 1); -pub const __STDC_VERSION__ = @as(c_long, 201710); -pub const __STDC_UTF_16__ = @as(c_int, 1); -pub const __STDC_UTF_32__ = @as(c_int, 1); -pub const __GLIBC_MINOR__ = @as(c_int, 19); -pub const _DEBUG = @as(c_int, 1); -pub const __GCC_HAVE_DWARF2_CFI_ASM = @as(c_int, 1); -pub const CLIENT_GAMEMODE_H = ""; -pub const __STDBOOL_H = ""; -pub const @"bool" = bool; -pub const @"true" = @as(c_int, 1); -pub const @"false" = @as(c_int, 0); -pub const __bool_true_false_are_defined = @as(c_int, 1); -pub const _STDIO_H = @as(c_int, 1); -pub const __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION = ""; -pub const _FEATURES_H = @as(c_int, 1); -pub const __KERNEL_STRICT_NAMES = ""; -pub inline fn __GNUC_PREREQ(maj: anytype, min: anytype) @TypeOf(((__GNUC__ << @as(c_int, 16)) + __GNUC_MINOR__) >= ((maj << @as(c_int, 16)) + min)) { - return ((__GNUC__ << @as(c_int, 16)) + __GNUC_MINOR__) >= ((maj << @as(c_int, 16)) + min); -} -pub inline fn __glibc_clang_prereq(maj: anytype, min: anytype) @TypeOf(((__clang_major__ << @as(c_int, 16)) + __clang_minor__) >= ((maj << @as(c_int, 16)) + min)) { - return ((__clang_major__ << @as(c_int, 16)) + __clang_minor__) >= ((maj << @as(c_int, 16)) + min); -} -pub const _DEFAULT_SOURCE = @as(c_int, 1); -pub const __GLIBC_USE_ISOC2X = @as(c_int, 0); -pub const __USE_ISOC11 = @as(c_int, 1); -pub const __USE_ISOC99 = @as(c_int, 1); -pub const __USE_ISOC95 = @as(c_int, 1); -pub const __USE_POSIX_IMPLICITLY = @as(c_int, 1); -pub const _POSIX_SOURCE = @as(c_int, 1); -pub const _POSIX_C_SOURCE = @as(c_long, 200809); -pub const __USE_POSIX = @as(c_int, 1); -pub const __USE_POSIX2 = @as(c_int, 1); -pub const __USE_POSIX199309 = @as(c_int, 1); -pub const __USE_POSIX199506 = @as(c_int, 1); -pub const __USE_XOPEN2K = @as(c_int, 1); -pub const __USE_XOPEN2K8 = @as(c_int, 1); -pub const _ATFILE_SOURCE = @as(c_int, 1); -pub const __WORDSIZE = @as(c_int, 64); -pub const __WORDSIZE_TIME64_COMPAT32 = @as(c_int, 1); -pub const __SYSCALL_WORDSIZE = @as(c_int, 64); -pub const __TIMESIZE = __WORDSIZE; -pub const __USE_MISC = @as(c_int, 1); -pub const __USE_ATFILE = @as(c_int, 1); -pub const __USE_FORTIFY_LEVEL = @as(c_int, 0); -pub const __GLIBC_USE_DEPRECATED_GETS = @as(c_int, 0); -pub const __GLIBC_USE_DEPRECATED_SCANF = @as(c_int, 0); -pub const _STDC_PREDEF_H = @as(c_int, 1); -pub const __STDC_IEC_559__ = @as(c_int, 1); -pub const __STDC_IEC_559_COMPLEX__ = @as(c_int, 1); -pub const __STDC_ISO_10646__ = @as(c_long, 201706); -pub const __GNU_LIBRARY__ = @as(c_int, 6); -pub const __GLIBC__ = @as(c_int, 2); -pub inline fn __GLIBC_PREREQ(maj: anytype, min: anytype) @TypeOf(((__GLIBC__ << @as(c_int, 16)) + __GLIBC_MINOR__) >= ((maj << @as(c_int, 16)) + min)) { - return ((__GLIBC__ << @as(c_int, 16)) + __GLIBC_MINOR__) >= ((maj << @as(c_int, 16)) + min); -} -pub const _SYS_CDEFS_H = @as(c_int, 1); -pub inline fn __glibc_has_builtin(name: anytype) @TypeOf(__has_builtin(name)) { - return __has_builtin(name); -} -pub const __LEAF = ""; -pub const __LEAF_ATTR = ""; -pub inline fn __P(args: anytype) @TypeOf(args) { - return args; -} -pub inline fn __PMT(args: anytype) @TypeOf(args) { - return args; -} -pub const __ptr_t = ?*anyopaque; -pub const __BEGIN_DECLS = ""; -pub const __END_DECLS = ""; -pub inline fn __bos(ptr: anytype) @TypeOf(__builtin_object_size(ptr, __USE_FORTIFY_LEVEL > @as(c_int, 1))) { - return __builtin_object_size(ptr, __USE_FORTIFY_LEVEL > @as(c_int, 1)); -} -pub inline fn __bos0(ptr: anytype) @TypeOf(__builtin_object_size(ptr, @as(c_int, 0))) { - return __builtin_object_size(ptr, @as(c_int, 0)); -} -pub inline fn __glibc_objsize0(__o: anytype) @TypeOf(__bos0(__o)) { - return __bos0(__o); -} -pub inline fn __glibc_objsize(__o: anytype) @TypeOf(__bos(__o)) { - return __bos(__o); -} -pub const __glibc_c99_flexarr_available = @as(c_int, 1); -pub inline fn __ASMNAME(cname: anytype) @TypeOf(__ASMNAME2(__USER_LABEL_PREFIX__, cname)) { - return __ASMNAME2(__USER_LABEL_PREFIX__, cname); -} -pub const __wur = ""; -pub const __fortify_function = __extern_always_inline ++ __attribute_artificial__; -pub inline fn __glibc_unlikely(cond: anytype) @TypeOf(__builtin_expect(cond, @as(c_int, 0))) { - return __builtin_expect(cond, @as(c_int, 0)); -} -pub inline fn __glibc_likely(cond: anytype) @TypeOf(__builtin_expect(cond, @as(c_int, 1))) { - return __builtin_expect(cond, @as(c_int, 1)); -} -pub const __attribute_nonstring__ = ""; -pub const __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = @as(c_int, 0); -pub inline fn __LDBL_REDIR1(name: anytype, proto: anytype, alias: anytype) @TypeOf(name ++ proto) { - _ = alias; - return name ++ proto; -} -pub inline fn __LDBL_REDIR(name: anytype, proto: anytype) @TypeOf(name ++ proto) { - return name ++ proto; -} -pub inline fn __LDBL_REDIR1_NTH(name: anytype, proto: anytype, alias: anytype) @TypeOf(name ++ proto ++ __THROW) { - _ = alias; - return name ++ proto ++ __THROW; -} -pub inline fn __LDBL_REDIR_NTH(name: anytype, proto: anytype) @TypeOf(name ++ proto ++ __THROW) { - return name ++ proto ++ __THROW; -} -pub inline fn __REDIRECT_LDBL(name: anytype, proto: anytype, alias: anytype) @TypeOf(__REDIRECT(name, proto, alias)) { - return __REDIRECT(name, proto, alias); -} -pub inline fn __REDIRECT_NTH_LDBL(name: anytype, proto: anytype, alias: anytype) @TypeOf(__REDIRECT_NTH(name, proto, alias)) { - return __REDIRECT_NTH(name, proto, alias); -} -pub const __HAVE_GENERIC_SELECTION = @as(c_int, 1); -pub const __attr_dealloc_free = ""; -pub const __stub___compat_bdflush = ""; -pub const __stub_chflags = ""; -pub const __stub_fchflags = ""; -pub const __stub_gtty = ""; -pub const __stub_revoke = ""; -pub const __stub_setlogin = ""; -pub const __stub_sigreturn = ""; -pub const __stub_stty = ""; -pub const __GLIBC_USE_LIB_EXT2 = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_BFP_EXT = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_EXT = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = @as(c_int, 0); -pub const __GLIBC_USE_IEC_60559_TYPES_EXT = @as(c_int, 0); -pub const __need_size_t = ""; -pub const __need_NULL = ""; -pub const _SIZE_T = ""; -pub const NULL = @import("std").zig.c_translation.cast(?*anyopaque, @as(c_int, 0)); -pub const __need___va_list = ""; -pub const __STDARG_H = ""; -pub const _VA_LIST = ""; -pub const __GNUC_VA_LIST = @as(c_int, 1); -pub const _BITS_TYPES_H = @as(c_int, 1); -pub const __S16_TYPE = c_short; -pub const __U16_TYPE = c_ushort; -pub const __S32_TYPE = c_int; -pub const __U32_TYPE = c_uint; -pub const __SLONGWORD_TYPE = c_long; -pub const __ULONGWORD_TYPE = c_ulong; -pub const __SQUAD_TYPE = c_long; -pub const __UQUAD_TYPE = c_ulong; -pub const __SWORD_TYPE = c_long; -pub const __UWORD_TYPE = c_ulong; -pub const __SLONG32_TYPE = c_int; -pub const __ULONG32_TYPE = c_uint; -pub const __S64_TYPE = c_long; -pub const __U64_TYPE = c_ulong; -pub const _BITS_TYPESIZES_H = @as(c_int, 1); -pub const __SYSCALL_SLONG_TYPE = __SLONGWORD_TYPE; -pub const __SYSCALL_ULONG_TYPE = __ULONGWORD_TYPE; -pub const __DEV_T_TYPE = __UQUAD_TYPE; -pub const __UID_T_TYPE = __U32_TYPE; -pub const __GID_T_TYPE = __U32_TYPE; -pub const __INO_T_TYPE = __SYSCALL_ULONG_TYPE; -pub const __INO64_T_TYPE = __UQUAD_TYPE; -pub const __MODE_T_TYPE = __U32_TYPE; -pub const __NLINK_T_TYPE = __SYSCALL_ULONG_TYPE; -pub const __FSWORD_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __OFF_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __OFF64_T_TYPE = __SQUAD_TYPE; -pub const __PID_T_TYPE = __S32_TYPE; -pub const __RLIM_T_TYPE = __SYSCALL_ULONG_TYPE; -pub const __RLIM64_T_TYPE = __UQUAD_TYPE; -pub const __BLKCNT_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __BLKCNT64_T_TYPE = __SQUAD_TYPE; -pub const __FSBLKCNT_T_TYPE = __SYSCALL_ULONG_TYPE; -pub const __FSBLKCNT64_T_TYPE = __UQUAD_TYPE; -pub const __FSFILCNT_T_TYPE = __SYSCALL_ULONG_TYPE; -pub const __FSFILCNT64_T_TYPE = __UQUAD_TYPE; -pub const __ID_T_TYPE = __U32_TYPE; -pub const __CLOCK_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __TIME_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __USECONDS_T_TYPE = __U32_TYPE; -pub const __SUSECONDS_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __SUSECONDS64_T_TYPE = __SQUAD_TYPE; -pub const __DADDR_T_TYPE = __S32_TYPE; -pub const __KEY_T_TYPE = __S32_TYPE; -pub const __CLOCKID_T_TYPE = __S32_TYPE; -pub const __TIMER_T_TYPE = ?*anyopaque; -pub const __BLKSIZE_T_TYPE = __SYSCALL_SLONG_TYPE; -pub const __SSIZE_T_TYPE = __SWORD_TYPE; -pub const __CPU_MASK_TYPE = __SYSCALL_ULONG_TYPE; -pub const __OFF_T_MATCHES_OFF64_T = @as(c_int, 1); -pub const __INO_T_MATCHES_INO64_T = @as(c_int, 1); -pub const __RLIM_T_MATCHES_RLIM64_T = @as(c_int, 1); -pub const __STATFS_MATCHES_STATFS64 = @as(c_int, 1); -pub const __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = @as(c_int, 1); -pub const __FD_SETSIZE = @as(c_int, 1024); -pub const _BITS_TIME64_H = @as(c_int, 1); -pub const __TIME64_T_TYPE = __TIME_T_TYPE; -pub const _____fpos_t_defined = @as(c_int, 1); -pub const ____mbstate_t_defined = @as(c_int, 1); -pub const _____fpos64_t_defined = @as(c_int, 1); -pub const ____FILE_defined = @as(c_int, 1); -pub const __FILE_defined = @as(c_int, 1); -pub const __struct_FILE_defined = @as(c_int, 1); -pub const _IO_EOF_SEEN = @as(c_int, 0x0010); -pub inline fn __feof_unlocked_body(_fp: anytype) @TypeOf((_fp.*._flags & _IO_EOF_SEEN) != @as(c_int, 0)) { - return (_fp.*._flags & _IO_EOF_SEEN) != @as(c_int, 0); -} -pub const _IO_ERR_SEEN = @as(c_int, 0x0020); -pub inline fn __ferror_unlocked_body(_fp: anytype) @TypeOf((_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0)) { - return (_fp.*._flags & _IO_ERR_SEEN) != @as(c_int, 0); -} -pub const _IO_USER_LOCK = @import("std").zig.c_translation.promoteIntLiteral(c_int, 0x8000, .hexadecimal); -pub const _VA_LIST_DEFINED = ""; -pub const __off_t_defined = ""; -pub const __ssize_t_defined = ""; -pub const _IOFBF = @as(c_int, 0); -pub const _IOLBF = @as(c_int, 1); -pub const _IONBF = @as(c_int, 2); -pub const BUFSIZ = @as(c_int, 8192); -pub const EOF = -@as(c_int, 1); -pub const SEEK_SET = @as(c_int, 0); -pub const SEEK_CUR = @as(c_int, 1); -pub const SEEK_END = @as(c_int, 2); -pub const P_tmpdir = "/tmp"; -pub const _BITS_STDIO_LIM_H = @as(c_int, 1); -pub const L_tmpnam = @as(c_int, 20); -pub const TMP_MAX = @import("std").zig.c_translation.promoteIntLiteral(c_int, 238328, .decimal); -pub const FILENAME_MAX = @as(c_int, 4096); -pub const L_ctermid = @as(c_int, 9); -pub const FOPEN_MAX = @as(c_int, 16); -pub const __attr_dealloc_fclose = __attr_dealloc(fclose, @as(c_int, 1)); -pub const _BITS_FLOATN_H = ""; -pub const __HAVE_FLOAT128 = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT128 = @as(c_int, 0); -pub const __HAVE_FLOAT64X = @as(c_int, 1); -pub const __HAVE_FLOAT64X_LONG_DOUBLE = @as(c_int, 1); -pub const _BITS_FLOATN_COMMON_H = ""; -pub const __HAVE_FLOAT16 = @as(c_int, 0); -pub const __HAVE_FLOAT32 = @as(c_int, 1); -pub const __HAVE_FLOAT64 = @as(c_int, 1); -pub const __HAVE_FLOAT32X = @as(c_int, 1); -pub const __HAVE_FLOAT128X = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT16 = __HAVE_FLOAT16; -pub const __HAVE_DISTINCT_FLOAT32 = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT64 = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT32X = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT64X = @as(c_int, 0); -pub const __HAVE_DISTINCT_FLOAT128X = __HAVE_FLOAT128X; -pub const __HAVE_FLOAT128_UNLIKE_LDBL = (__HAVE_DISTINCT_FLOAT128 != 0) and (__LDBL_MANT_DIG__ != @as(c_int, 113)); -pub const __HAVE_FLOATN_NOT_TYPEDEF = @as(c_int, 0); -pub const __f32 = @import("std").zig.c_translation.Macros.F_SUFFIX; -pub inline fn __f64(x: anytype) @TypeOf(x) { - return x; -} -pub inline fn __f32x(x: anytype) @TypeOf(x) { - return x; -} -pub const __f64x = @import("std").zig.c_translation.Macros.L_SUFFIX; -pub inline fn __builtin_huge_valf32() @TypeOf(__builtin_huge_valf()) { - return __builtin_huge_valf(); -} -pub inline fn __builtin_inff32() @TypeOf(__builtin_inff()) { - return __builtin_inff(); -} -pub inline fn __builtin_nanf32(x: anytype) @TypeOf(__builtin_nanf(x)) { - return __builtin_nanf(x); -} -pub const _DLFCN_H = @as(c_int, 1); -pub const RTLD_LAZY = @as(c_int, 0x00001); -pub const RTLD_NOW = @as(c_int, 0x00002); -pub const RTLD_BINDING_MASK = @as(c_int, 0x3); -pub const RTLD_NOLOAD = @as(c_int, 0x00004); -pub const RTLD_DEEPBIND = @as(c_int, 0x00008); -pub const RTLD_GLOBAL = @as(c_int, 0x00100); -pub const RTLD_LOCAL = @as(c_int, 0); -pub const RTLD_NODELETE = @as(c_int, 0x01000); -pub const _STRING_H = @as(c_int, 1); -pub const _BITS_TYPES_LOCALE_T_H = @as(c_int, 1); -pub const _BITS_TYPES___LOCALE_T_H = @as(c_int, 1); -pub const _STRINGS_H = @as(c_int, 1); -pub const _ASSERT_H = @as(c_int, 1); -pub const _SYS_TYPES_H = @as(c_int, 1); -pub const __u_char_defined = ""; -pub const __ino_t_defined = ""; -pub const __dev_t_defined = ""; -pub const __gid_t_defined = ""; -pub const __mode_t_defined = ""; -pub const __nlink_t_defined = ""; -pub const __uid_t_defined = ""; -pub const __pid_t_defined = ""; -pub const __id_t_defined = ""; -pub const __daddr_t_defined = ""; -pub const __key_t_defined = ""; -pub const __clock_t_defined = @as(c_int, 1); -pub const __clockid_t_defined = @as(c_int, 1); -pub const __time_t_defined = @as(c_int, 1); -pub const __timer_t_defined = @as(c_int, 1); -pub const _BITS_STDINT_INTN_H = @as(c_int, 1); -pub const __BIT_TYPES_DEFINED__ = @as(c_int, 1); -pub const _ENDIAN_H = @as(c_int, 1); -pub const _BITS_ENDIAN_H = @as(c_int, 1); -pub const __LITTLE_ENDIAN = @as(c_int, 1234); -pub const __BIG_ENDIAN = @as(c_int, 4321); -pub const __PDP_ENDIAN = @as(c_int, 3412); -pub const _BITS_ENDIANNESS_H = @as(c_int, 1); -pub const __BYTE_ORDER = __LITTLE_ENDIAN; -pub const __FLOAT_WORD_ORDER = __BYTE_ORDER; -pub inline fn __LONG_LONG_PAIR(HI: anytype, LO: anytype) @TypeOf(HI) { - return blk: { - _ = LO; - break :blk HI; - }; -} -pub const LITTLE_ENDIAN = __LITTLE_ENDIAN; -pub const BIG_ENDIAN = __BIG_ENDIAN; -pub const PDP_ENDIAN = __PDP_ENDIAN; -pub const BYTE_ORDER = __BYTE_ORDER; -pub const _BITS_BYTESWAP_H = @as(c_int, 1); -pub inline fn __bswap_constant_16(x: anytype) __uint16_t { - return @import("std").zig.c_translation.cast(__uint16_t, ((x >> @as(c_int, 8)) & @as(c_int, 0xff)) | ((x & @as(c_int, 0xff)) << @as(c_int, 8))); -} -pub inline fn __bswap_constant_32(x: anytype) @TypeOf(((((x & @import("std").zig.c_translation.promoteIntLiteral(c_uint, 0xff000000, .hexadecimal)) >> @as(c_int, 24)) | ((x & @import("std").zig.c_translation.promoteIntLiteral(c_uint, 0x00ff0000, .hexadecimal)) >> @as(c_int, 8))) | ((x & @as(c_uint, 0x0000ff00)) << @as(c_int, 8))) | ((x & @as(c_uint, 0x000000ff)) << @as(c_int, 24))) { - return ((((x & @import("std").zig.c_translation.promoteIntLiteral(c_uint, 0xff000000, .hexadecimal)) >> @as(c_int, 24)) | ((x & @import("std").zig.c_translation.promoteIntLiteral(c_uint, 0x00ff0000, .hexadecimal)) >> @as(c_int, 8))) | ((x & @as(c_uint, 0x0000ff00)) << @as(c_int, 8))) | ((x & @as(c_uint, 0x000000ff)) << @as(c_int, 24)); -} -pub inline fn __bswap_constant_64(x: anytype) @TypeOf(((((((((x & @as(c_ulonglong, 0xff00000000000000)) >> @as(c_int, 56)) | ((x & @as(c_ulonglong, 0x00ff000000000000)) >> @as(c_int, 40))) | ((x & @as(c_ulonglong, 0x0000ff0000000000)) >> @as(c_int, 24))) | ((x & @as(c_ulonglong, 0x000000ff00000000)) >> @as(c_int, 8))) | ((x & @as(c_ulonglong, 0x00000000ff000000)) << @as(c_int, 8))) | ((x & @as(c_ulonglong, 0x0000000000ff0000)) << @as(c_int, 24))) | ((x & @as(c_ulonglong, 0x000000000000ff00)) << @as(c_int, 40))) | ((x & @as(c_ulonglong, 0x00000000000000ff)) << @as(c_int, 56))) { - return ((((((((x & @as(c_ulonglong, 0xff00000000000000)) >> @as(c_int, 56)) | ((x & @as(c_ulonglong, 0x00ff000000000000)) >> @as(c_int, 40))) | ((x & @as(c_ulonglong, 0x0000ff0000000000)) >> @as(c_int, 24))) | ((x & @as(c_ulonglong, 0x000000ff00000000)) >> @as(c_int, 8))) | ((x & @as(c_ulonglong, 0x00000000ff000000)) << @as(c_int, 8))) | ((x & @as(c_ulonglong, 0x0000000000ff0000)) << @as(c_int, 24))) | ((x & @as(c_ulonglong, 0x000000000000ff00)) << @as(c_int, 40))) | ((x & @as(c_ulonglong, 0x00000000000000ff)) << @as(c_int, 56)); -} -pub const _BITS_UINTN_IDENTITY_H = @as(c_int, 1); -pub inline fn htobe16(x: anytype) @TypeOf(__bswap_16(x)) { - return __bswap_16(x); -} -pub inline fn htole16(x: anytype) @TypeOf(__uint16_identity(x)) { - return __uint16_identity(x); -} -pub inline fn be16toh(x: anytype) @TypeOf(__bswap_16(x)) { - return __bswap_16(x); -} -pub inline fn le16toh(x: anytype) @TypeOf(__uint16_identity(x)) { - return __uint16_identity(x); -} -pub inline fn htobe32(x: anytype) @TypeOf(__bswap_32(x)) { - return __bswap_32(x); -} -pub inline fn htole32(x: anytype) @TypeOf(__uint32_identity(x)) { - return __uint32_identity(x); -} -pub inline fn be32toh(x: anytype) @TypeOf(__bswap_32(x)) { - return __bswap_32(x); -} -pub inline fn le32toh(x: anytype) @TypeOf(__uint32_identity(x)) { - return __uint32_identity(x); -} -pub inline fn htobe64(x: anytype) @TypeOf(__bswap_64(x)) { - return __bswap_64(x); -} -pub inline fn htole64(x: anytype) @TypeOf(__uint64_identity(x)) { - return __uint64_identity(x); -} -pub inline fn be64toh(x: anytype) @TypeOf(__bswap_64(x)) { - return __bswap_64(x); -} -pub inline fn le64toh(x: anytype) @TypeOf(__uint64_identity(x)) { - return __uint64_identity(x); -} -pub const _SYS_SELECT_H = @as(c_int, 1); -pub inline fn __FD_ISSET(d: anytype, s: anytype) @TypeOf((__FDS_BITS(s)[__FD_ELT(d)] & __FD_MASK(d)) != @as(c_int, 0)) { - return (__FDS_BITS(s)[__FD_ELT(d)] & __FD_MASK(d)) != @as(c_int, 0); -} -pub const __sigset_t_defined = @as(c_int, 1); -pub const ____sigset_t_defined = ""; -pub const _SIGSET_NWORDS = @as(c_int, 1024) / (@as(c_int, 8) * @import("std").zig.c_translation.sizeof(c_ulong)); -pub const __timeval_defined = @as(c_int, 1); -pub const _STRUCT_TIMESPEC = @as(c_int, 1); -pub const __suseconds_t_defined = ""; -pub const __NFDBITS = @as(c_int, 8) * @import("std").zig.c_translation.cast(c_int, @import("std").zig.c_translation.sizeof(__fd_mask)); -pub inline fn __FD_ELT(d: anytype) @TypeOf(d / __NFDBITS) { - return d / __NFDBITS; -} -pub inline fn __FD_MASK(d: anytype) __fd_mask { - return @import("std").zig.c_translation.cast(__fd_mask, @as(c_ulong, 1) << (d % __NFDBITS)); -} -pub inline fn __FDS_BITS(set: anytype) @TypeOf(set.*.__fds_bits) { - return set.*.__fds_bits; -} -pub const FD_SETSIZE = __FD_SETSIZE; -pub const NFDBITS = __NFDBITS; -pub inline fn FD_SET(fd: anytype, fdsetp: anytype) @TypeOf(__FD_SET(fd, fdsetp)) { - return __FD_SET(fd, fdsetp); -} -pub inline fn FD_CLR(fd: anytype, fdsetp: anytype) @TypeOf(__FD_CLR(fd, fdsetp)) { - return __FD_CLR(fd, fdsetp); -} -pub inline fn FD_ISSET(fd: anytype, fdsetp: anytype) @TypeOf(__FD_ISSET(fd, fdsetp)) { - return __FD_ISSET(fd, fdsetp); -} -pub inline fn FD_ZERO(fdsetp: anytype) @TypeOf(__FD_ZERO(fdsetp)) { - return __FD_ZERO(fdsetp); -} -pub const __blksize_t_defined = ""; -pub const __blkcnt_t_defined = ""; -pub const __fsblkcnt_t_defined = ""; -pub const __fsfilcnt_t_defined = ""; -pub const _BITS_PTHREADTYPES_COMMON_H = @as(c_int, 1); -pub const _THREAD_SHARED_TYPES_H = @as(c_int, 1); -pub const _BITS_PTHREADTYPES_ARCH_H = @as(c_int, 1); -pub const __SIZEOF_PTHREAD_MUTEX_T = @as(c_int, 40); -pub const __SIZEOF_PTHREAD_ATTR_T = @as(c_int, 56); -pub const __SIZEOF_PTHREAD_RWLOCK_T = @as(c_int, 56); -pub const __SIZEOF_PTHREAD_BARRIER_T = @as(c_int, 32); -pub const __SIZEOF_PTHREAD_MUTEXATTR_T = @as(c_int, 4); -pub const __SIZEOF_PTHREAD_COND_T = @as(c_int, 48); -pub const __SIZEOF_PTHREAD_CONDATTR_T = @as(c_int, 4); -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T = @as(c_int, 8); -pub const __SIZEOF_PTHREAD_BARRIERATTR_T = @as(c_int, 4); -pub const __LOCK_ALIGNMENT = ""; -pub const __ONCE_ALIGNMENT = ""; -pub const _THREAD_MUTEX_INTERNAL_H = @as(c_int, 1); -pub const __PTHREAD_MUTEX_HAVE_PREV = @as(c_int, 1); -pub const _RWLOCK_INTERNAL_H = ""; -pub inline fn __PTHREAD_RWLOCK_INITIALIZER(__flags: anytype) @TypeOf(__flags) { - return blk: { - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = @as(c_int, 0); - _ = __PTHREAD_RWLOCK_ELISION_EXTRA; - _ = @as(c_int, 0); - break :blk __flags; - }; -} -pub const __have_pthread_attr_t = @as(c_int, 1); -pub const __va_list_tag = struct___va_list_tag; -pub const _G_fpos_t = struct__G_fpos_t; -pub const _G_fpos64_t = struct__G_fpos64_t; -pub const _IO_marker = struct__IO_marker; -pub const _IO_codecvt = struct__IO_codecvt; -pub const _IO_wide_data = struct__IO_wide_data; -pub const _IO_FILE = struct__IO_FILE; -pub const __locale_data = struct___locale_data; -pub const __locale_struct = struct___locale_struct; -pub const timeval = struct_timeval; -pub const timespec = struct_timespec; -pub const __pthread_internal_list = struct___pthread_internal_list; -pub const __pthread_internal_slist = struct___pthread_internal_slist; -pub const __pthread_mutex_s = struct___pthread_mutex_s; -pub const __pthread_rwlock_arch_t = struct___pthread_rwlock_arch_t; -pub const __pthread_cond_s = struct___pthread_cond_s; diff --git a/libs/glfw/src/opengl.zig b/libs/glfw/src/opengl.zig index 10b0e361..bddaa1c7 100644 --- a/libs/glfw/src/opengl.zig +++ b/libs/glfw/src/opengl.zig @@ -153,7 +153,7 @@ const builtin = @import("builtin"); /// Generic function pointer used for returning client API function pointers. /// /// see also: context_glext, glfwGetProcAddress -pub const GLProc = if (builtin.zig_backend == .stage1 or builtin.zig_backend == .other) fn () callconv(.C) void else *const fn () callconv(.C) void; +pub const GLProc = *const fn () callconv(.C) void; /// Returns the address of the specified function for the current context. /// diff --git a/libs/glfw/src/vulkan.zig b/libs/glfw/src/vulkan.zig index 4b59bfda..f9836149 100644 --- a/libs/glfw/src/vulkan.zig +++ b/libs/glfw/src/vulkan.zig @@ -34,10 +34,7 @@ pub fn initVulkanLoader(loader_function: ?VKGetInstanceProcAddr) void { c.glfwInitVulkanLoader(loader_function orelse null); } -pub const VKGetInstanceProcAddr = if (@import("builtin").zig_backend == .stage1) - fn (vk_instance: c.VkInstance, name: [*c]const u8) callconv(.C) ?VKProc -else - *const fn (vk_instance: c.VkInstance, name: [*c]const u8) callconv(.C) ?VKProc; +pub const VKGetInstanceProcAddr = *const fn (vk_instance: c.VkInstance, name: [*c]const u8) callconv(.C) ?VKProc; /// Returns whether the Vulkan loader and an ICD have been found. /// @@ -106,10 +103,7 @@ pub inline fn getRequiredInstanceExtensions() error{APIUnavailable}![][*:0]const /// Generic function pointer used for returning Vulkan API function pointers. /// /// see also: vulkan_proc, glfw.getInstanceProcAddress -pub const VKProc = if (@import("builtin").zig_backend == .stage1) - fn () callconv(.C) void -else - *const fn () callconv(.C) void; +pub const VKProc = *const fn () callconv(.C) void; /// Returns the address of the specified Vulkan instance function. /// diff --git a/libs/gpu/examples/sample_utils.zig b/libs/gpu/examples/sample_utils.zig index 6cfa0d59..1c201443 100644 --- a/libs/gpu/examples/sample_utils.zig +++ b/libs/gpu/examples/sample_utils.zig @@ -233,16 +233,7 @@ pub const AutoReleasePool = if (!@import("builtin").target.isDarwin()) opaque { pub fn msgSend(obj: anytype, sel_name: [:0]const u8, args: anytype, comptime ReturnType: type) ReturnType { const args_meta = @typeInfo(@TypeOf(args)).Struct.fields; - const FnType = if (@import("builtin").zig_backend == .stage1) - switch (args_meta.len) { - 0 => fn (@TypeOf(obj), objc.SEL) callconv(.C) ReturnType, - 1 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type) callconv(.C) ReturnType, - 2 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type) callconv(.C) ReturnType, - 3 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type, args_meta[2].field_type) callconv(.C) ReturnType, - 4 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type, args_meta[2].field_type, args_meta[3].field_type) callconv(.C) ReturnType, - else => @compileError("Unsupported number of args"), - } - else switch (args_meta.len) { + const FnType = switch (args_meta.len) { 0 => *const fn (@TypeOf(obj), objc.SEL) callconv(.C) ReturnType, 1 => *const fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type) callconv(.C) ReturnType, 2 => *const fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type) callconv(.C) ReturnType, @@ -252,10 +243,7 @@ pub fn msgSend(obj: anytype, sel_name: [:0]const u8, args: anytype, comptime Ret }; // NOTE: func is a var because making it const causes a compile error which I believe is a compiler bug - var func = if (@import("builtin").zig_backend == .stage1) - @ptrCast(FnType, objc.objc_msgSend) - else - @ptrCast(FnType, &objc.objc_msgSend); + var func = @ptrCast(FnType, &objc.objc_msgSend); const sel = objc.sel_getUid(@ptrCast([*c]const u8, sel_name)); return @call(.{}, func, .{ obj, sel } ++ args); diff --git a/libs/gpu/src/buffer.zig b/libs/gpu/src/buffer.zig index aab2ec70..6f432be5 100644 --- a/libs/gpu/src/buffer.zig +++ b/libs/gpu/src/buffer.zig @@ -4,10 +4,7 @@ const MapModeFlags = @import("types.zig").MapModeFlags; const Impl = @import("interface.zig").Impl; pub const Buffer = opaque { - pub const MapCallback = if (@import("builtin").zig_backend == .stage1) - fn (status: MapAsyncStatus, userdata: ?*anyopaque) callconv(.C) void - else - *const fn (status: MapAsyncStatus, userdata: ?*anyopaque) callconv(.C) void; + pub const MapCallback = *const fn (status: MapAsyncStatus, userdata: ?*anyopaque) callconv(.C) void; pub const BindingType = enum(u32) { undef = 0x00000000, diff --git a/libs/gpu/src/callbacks.zig b/libs/gpu/src/callbacks.zig index 6a164e11..41c3a2cf 100644 --- a/libs/gpu/src/callbacks.zig +++ b/libs/gpu/src/callbacks.zig @@ -10,101 +10,48 @@ const Adapter = @import("adapter.zig").Adapter; const ComputePipeline = @import("compute_pipeline.zig").ComputePipeline; const RenderPipeline = @import("render_pipeline.zig").RenderPipeline; -pub const CompilationInfoCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: CompilationInfoRequestStatus, - compilation_info: *const CompilationInfo, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - status: CompilationInfoRequestStatus, - compilation_info: *const CompilationInfo, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const CompilationInfoCallback = *const fn ( + status: CompilationInfoRequestStatus, + compilation_info: *const CompilationInfo, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const ErrorCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - typ: ErrorType, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - typ: ErrorType, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const ErrorCallback = *const fn ( + typ: ErrorType, + message: [*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const LoggingCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - typ: LoggingType, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - typ: LoggingType, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const LoggingCallback = *const fn ( + typ: LoggingType, + message: [*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const RequestDeviceCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: RequestDeviceStatus, - device: *Device, - message: ?[*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - status: RequestDeviceStatus, - device: *Device, - message: ?[*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const RequestDeviceCallback = *const fn ( + status: RequestDeviceStatus, + device: *Device, + message: ?[*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const RequestAdapterCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: RequestAdapterStatus, - adapter: *Adapter, - message: ?[*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - status: RequestAdapterStatus, - adapter: *Adapter, - message: ?[*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const RequestAdapterCallback = *const fn ( + status: RequestAdapterStatus, + adapter: *Adapter, + message: ?[*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const CreateComputePipelineAsyncCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: CreatePipelineAsyncStatus, - compute_pipeline: *ComputePipeline, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - status: CreatePipelineAsyncStatus, - compute_pipeline: *ComputePipeline, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const CreateComputePipelineAsyncCallback = *const fn ( + status: CreatePipelineAsyncStatus, + compute_pipeline: *ComputePipeline, + message: [*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; -pub const CreateRenderPipelineAsyncCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: CreatePipelineAsyncStatus, - pipeline: *RenderPipeline, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void -else - *const fn ( - status: CreatePipelineAsyncStatus, - pipeline: *RenderPipeline, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; +pub const CreateRenderPipelineAsyncCallback = *const fn ( + status: CreatePipelineAsyncStatus, + pipeline: *RenderPipeline, + message: [*:0]const u8, + userdata: ?*anyopaque, +) callconv(.C) void; diff --git a/libs/gpu/src/dawn_impl.zig b/libs/gpu/src/dawn_impl.zig index 245a9847..175c844e 100644 --- a/libs/gpu/src/dawn_impl.zig +++ b/libs/gpu/src/dawn_impl.zig @@ -1,18 +1,9 @@ const gpu = @import("main.zig"); -const c = if (@import("builtin").zig_backend == .stage1 or !@import("builtin").target.isDarwin()) - @cImport({ - @cInclude("dawn/webgpu.h"); - @cInclude("mach_dawn.h"); - }) -else - // TODO(self-hosted): HACK: workaround https://github.com/ziglang/zig/issues/12483 - // - // cd gpu/src/ - // echo '#include ' > tmp.c - // echo '#include "mach_dawn.h"' >> tmp.c - // zig translate-c tmp.c -I ../zig-cache/mach/gpu-dawn/release-777728f/include/ > dawn_webgpu_h.zig - @import("dawn_webgpu_h.zig"); +const c = @cImport({ + @cInclude("dawn/webgpu.h"); + @cInclude("mach_dawn.h"); +}); var procs: c.DawnProcTable = undefined; diff --git a/libs/gpu/src/device.zig b/libs/gpu/src/device.zig index 5785a5d4..2ad11d0d 100644 --- a/libs/gpu/src/device.zig +++ b/libs/gpu/src/device.zig @@ -31,18 +31,11 @@ const Impl = @import("interface.zig").Impl; const dawn = @import("dawn.zig"); pub const Device = opaque { - pub const LostCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - reason: LostReason, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void - else - *const fn ( - reason: LostReason, - message: [*:0]const u8, - userdata: ?*anyopaque, - ) callconv(.C) void; + pub const LostCallback = *const fn ( + reason: LostReason, + message: [*:0]const u8, + userdata: ?*anyopaque, + ) callconv(.C) void; pub const LostReason = enum(u32) { undef = 0x00000000, diff --git a/libs/gpu/src/queue.zig b/libs/gpu/src/queue.zig index 831e8d3c..c25ee32e 100644 --- a/libs/gpu/src/queue.zig +++ b/libs/gpu/src/queue.zig @@ -9,16 +9,10 @@ const CopyTextureForBrowserOptions = @import("types.zig").CopyTextureForBrowserO const Impl = @import("interface.zig").Impl; pub const Queue = opaque { - pub const WorkDoneCallback = if (@import("builtin").zig_backend == .stage1) - fn ( - status: WorkDoneStatus, - userdata: ?*anyopaque, - ) callconv(.C) void - else - *const fn ( - status: WorkDoneStatus, - userdata: ?*anyopaque, - ) callconv(.C) void; + pub const WorkDoneCallback = *const fn ( + status: WorkDoneStatus, + userdata: ?*anyopaque, + ) callconv(.C) void; pub const WorkDoneStatus = enum(u32) { success = 0x00000000, diff --git a/libs/gpu/src/types.zig b/libs/gpu/src/types.zig index d1616dc7..5c2ef05c 100644 --- a/libs/gpu/src/types.zig +++ b/libs/gpu/src/types.zig @@ -17,10 +17,7 @@ pub const whole_size = 0xffffffffffffffff; /// Generic function pointer type, used for returning API function pointers. Must be /// cast to the right `fn (...) callconv(.C) T` type before use. -pub const Proc = if (@import("builtin").zig_backend == .stage1) - fn () callconv(.C) void -else - *const fn () callconv(.C) void; +pub const Proc = *const fn () callconv(.C) void; pub const ComputePassTimestampWrite = extern struct { query_set: *QuerySet, diff --git a/libs/sysaudio/soundio/InStream.zig b/libs/sysaudio/soundio/InStream.zig index 1f464f25..aa1dc21c 100644 --- a/libs/sysaudio/soundio/InStream.zig +++ b/libs/sysaudio/soundio/InStream.zig @@ -6,10 +6,7 @@ const ChannelLayout = @import("ChannelLayout.zig"); const InStream = @This(); -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; +pub const WriteCallback = *const fn (stream: ?[*]c.SoundIoInStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void; handle: *c.SoundIoInStream, diff --git a/libs/sysaudio/soundio/OutStream.zig b/libs/sysaudio/soundio/OutStream.zig index bac78e5e..e03ea3be 100644 --- a/libs/sysaudio/soundio/OutStream.zig +++ b/libs/sysaudio/soundio/OutStream.zig @@ -6,10 +6,7 @@ const ChannelLayout = @import("ChannelLayout.zig"); const OutStream = @This(); -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; +pub const WriteCallback = *const fn (stream: ?[*]c.SoundIoOutStream, frame_count_min: c_int, frame_count_max: c_int) callconv(.C) void; handle: *c.SoundIoOutStream, diff --git a/libs/sysaudio/src/soundio.zig b/libs/sysaudio/src/soundio.zig index e2d96a26..6db75704 100644 --- a/libs/sysaudio/src/soundio.zig +++ b/libs/sysaudio/src/soundio.zig @@ -16,10 +16,7 @@ const SoundIoStream = union(Mode) { const Audio = @This(); -pub const DataCallback = if (@import("builtin").zig_backend == .stage1) - fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void -else - *const fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void; +pub const DataCallback = *const fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void; const default_buffer_size_per_channel = 1024; // 21.33ms diff --git a/libs/sysaudio/src/webaudio.zig b/libs/sysaudio/src/webaudio.zig index 3fe7dc3d..9b7c482d 100644 --- a/libs/sysaudio/src/webaudio.zig +++ b/libs/sysaudio/src/webaudio.zig @@ -5,10 +5,7 @@ const js = @import("sysjs"); const Audio = @This(); -pub const DataCallback = if (@import("builtin").zig_backend == .stage1) - fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void -else - *const fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void; +pub const DataCallback = *const fn (device: *Device, user_data: ?*anyopaque, buffer: []u8) void; pub const Device = struct { properties: Properties, diff --git a/libs/sysjs/src/main.zig b/libs/sysjs/src/main.zig index 9a65723a..682550f6 100644 --- a/libs/sysjs/src/main.zig +++ b/libs/sysjs/src/main.zig @@ -208,12 +208,8 @@ export fn wasmCallFunction(id: *anyopaque, args: u32, len: u32, captures: [*]Val captures_slice.len = captures_len; const obj = Object{ .ref = args }; - if (builtin.zig_backend == .stage1) { - obj.set("return_value", functions.items[@ptrToInt(id) - 1](obj, len, captures_slice)); - } else { - var func = @ptrCast(FunType, @alignCast(std.meta.alignment(FunType), id)); - obj.set("return_value", func(obj, len, captures_slice)); - } + var func = @ptrCast(FunType, @alignCast(std.meta.alignment(FunType), id)); + obj.set("return_value", func(obj, len, captures_slice)); } pub fn global() Object { @@ -248,18 +244,9 @@ pub fn createUndefined() Value { return .{ .tag = .undef, .val = undefined }; } -const FunType = if (@import("builtin").zig_backend == .stage1) - fn (args: Object, args_len: u32, captures: []Value) Value -else - *const fn (args: Object, args_len: u32, captures: []Value) Value; - -var functions: std.ArrayListUnmanaged(FunType) = .{}; +const FunType = *const fn (args: Object, args_len: u32, captures: []Value) Value; pub fn createFunction(fun: FunType, captures: []Value) Function { - if (builtin.zig_backend == .stage1) { - functions.append(std.heap.page_allocator, fun) catch unreachable; - return .{ .ref = js.zigCreateFunction(@intToPtr(*anyopaque, functions.items.len), captures.ptr, @intCast(u32, captures.len)) }; - } return .{ .ref = js.zigCreateFunction(fun, captures.ptr, captures.len) }; } diff --git a/src/platform/native.zig b/src/platform/native.zig index c4517ea4..e72b94a8 100644 --- a/src/platform/native.zig +++ b/src/platform/native.zig @@ -639,10 +639,7 @@ pub fn coreDeinit(core: *Core, allocator: std.mem.Allocator) void { allocator.destroy(core); } -pub const CoreResizeCallback = if (@import("builtin").zig_backend == .stage1) - fn (*Core, u32, u32) callconv(.C) void -else - *const fn (*Core, u32, u32) callconv(.C) void; +pub const CoreResizeCallback = *const fn (*Core, u32, u32) callconv(.C) void; pub fn coreUpdate(core: *Core, resize: ?CoreResizeCallback) !void { if (core.internal.wait_event_timeout > 0.0) { diff --git a/src/platform/util.zig b/src/platform/util.zig index 5de3bf62..0c3922c2 100644 --- a/src/platform/util.zig +++ b/src/platform/util.zig @@ -167,16 +167,7 @@ pub const AutoReleasePool = if (!@import("builtin").target.isDarwin()) opaque { pub fn msgSend(obj: anytype, sel_name: [:0]const u8, args: anytype, comptime ReturnType: type) ReturnType { const args_meta = @typeInfo(@TypeOf(args)).Struct.fields; - const FnType = if (@import("builtin").zig_backend == .stage1) - switch (args_meta.len) { - 0 => fn (@TypeOf(obj), objc.SEL) callconv(.C) ReturnType, - 1 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type) callconv(.C) ReturnType, - 2 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type) callconv(.C) ReturnType, - 3 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type, args_meta[2].field_type) callconv(.C) ReturnType, - 4 => fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type, args_meta[2].field_type, args_meta[3].field_type) callconv(.C) ReturnType, - else => @compileError("Unsupported number of args"), - } - else switch (args_meta.len) { + const FnType = switch (args_meta.len) { 0 => *const fn (@TypeOf(obj), objc.SEL) callconv(.C) ReturnType, 1 => *const fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type) callconv(.C) ReturnType, 2 => *const fn (@TypeOf(obj), objc.SEL, args_meta[0].field_type, args_meta[1].field_type) callconv(.C) ReturnType, @@ -186,10 +177,7 @@ pub fn msgSend(obj: anytype, sel_name: [:0]const u8, args: anytype, comptime Ret }; // NOTE: func is a var because making it const causes a compile error which I believe is a compiler bug - var func = if (@import("builtin").zig_backend == .stage1) - @ptrCast(FnType, objc.objc_msgSend) - else - @ptrCast(FnType, &objc.objc_msgSend); + var func = @ptrCast(FnType, &objc.objc_msgSend); const sel = objc.sel_getUid(@ptrCast([*c]const u8, sel_name)); return @call(.{}, func, .{ obj, sel } ++ args);