Skip to content

Upgrade Zig to new Mach nominated ver 0.14.0-dev.1911+3bf89f55c #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b54e5cd
up zig version to 0.14.0-dev.1398+c34cfe486
hazeycode Sep 1, 2024
7859a07
zgui, zglfw, zmath, zmesh, zpool: update for 0.14.0-dev changes (#687)
kcbanner Sep 1, 2024
d2a4a49
fixes for Zig 0.14.0-dev.1398+c34cfe486
hazeycode Sep 1, 2024
98fb143
more fixes for Zig 0.14.0-dev.1398+c34cfe486
hazeycode Sep 1, 2024
f2ee5f9
zgpu: Zig 0.14.0-dev.1398+c34cfe486 fixes (macOS)
hazeycode Sep 2, 2024
b46101a
Merge branch 'main' into zig-0.14.0
hazeycode Sep 6, 2024
66c411c
Remove kfreebsd as it is no longer supported by zig
Sep 8, 2024
7c8e468
Merge pull request #699 from CoffeeImpliesCode/fix-platforms
hazeycode Sep 8, 2024
4519447
Merge branch 'main' into zig-0.14.0
hazeycode Sep 8, 2024
975483f
[zopengl] fixup c export syntax
hazeycode Sep 8, 2024
17008a5
up Zig to 0.14.0-dev.1550+4fba7336a
hazeycode Sep 13, 2024
f4d2510
Merge branch 'main' into zig-0.14.0
hazeycode Sep 13, 2024
a1b53d6
Merge branch 'main' into zig-0.14.0
hazeycode Sep 21, 2024
c2fe725
Merge branch 'main' into zig-0.14.0
hazeycode Sep 29, 2024
3e71622
Zig 0.14.0-dev.1550+4fba7336a fixups
hazeycode Sep 29, 2024
6edba00
Merge branch 'main' into zig-0.14.0
hazeycode Oct 1, 2024
82f88a7
Some fix for 0.14.0-dev.1710+8ee52f99c (#715)
OndraVoves Oct 11, 2024
32e9b8e
zaudio: add vfs support for engine's config (#716)
Jack-Ji Oct 11, 2024
ef2a77a
Merge branch 'main' into zig-0.14.0
hazeycode Oct 11, 2024
d99edb1
Upgrade Zig to new Mach nominated ver 0.14.0-dev.1710+8ee52f99c
hazeycode Oct 11, 2024
ab88fd1
Merge branch 'main' into zig-0.14.0
hazeycode Oct 13, 2024
836fb32
Merge branch 'main' into zig-0.14.0
hazeycode Oct 18, 2024
2fd6950
Upgrade Zig to new Mach nominated ver 0.14.0-dev.1911+3bf89f55c
hazeycode Oct 18, 2024
7c6a0ac
samples add system lib paths (macos)
hazeycode Oct 21, 2024
2781f4e
Merge branch 'main' into zig-0.14.0
hazeycode Oct 22, 2024
e7e8ebe
Merge branch 'main' into zig-0.14.0
hazeycode Oct 22, 2024
9ae1873
zwindows build.zig: fix paths for zig 0.14.0
hazeycode Oct 22, 2024
9a2a7d3
Zig 0.14.0 rename std.fs.MAX_PATH_BYTES -> std.fs.max_path_bytes
hazeycode Oct 22, 2024
71ece77
zwindows/zd3d12 zig 0.14.0 fixup
hazeycode Oct 22, 2024
48c6fab
zopenvr build.zig: fixup paths for Zig 0.14.0
hazeycode Oct 22, 2024
01e3ba9
openvr_test: Zig 0.14.0 fixups
hazeycode Oct 22, 2024
0c6dfb2
Merge branch 'main' into zig-0.14.0
hazeycode Nov 2, 2024
fe94674
zmesh, zphysics, and ztracy changes for building for x86_64-windows-m…
kcbanner Nov 2, 2024
db86f13
[TEMP] Undo zig master change from fe9467428f5bc61051dbfffc7c31407463…
hazeycode Nov 2, 2024
29e22be
[TEMP] CI: Disable macOS build
hazeycode Nov 2, 2024
66b2a3f
[TEMP] Disable monolith and physics_test_wgpu
hazeycode Nov 2, 2024
4d7d629
update README
hazeycode Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
runs-on: ${{matrix.os}}
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .zigversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.13.0-dev.351+64ef45eb0
0.14.0-dev.1911+3bf89f55c
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Note: If using Git then you will need [Git LFS](https://git-lfs.github.com/) to

### Get Zig

Our [main](https://github.com/zig-gamedev/zig-gamedev/tree/main) branch is currenly tracking Zig **0.13.0-dev.351+64ef45eb0**. Or you can use the **unstable** [zig-0.14.0 branch](https://github.com/zig-gamedev/zig-gamedev/tree/zig-0.14.0).
Our [main](https://github.com/zig-gamedev/zig-gamedev/tree/main) branch is currenly tracking Zig **0.14.0-dev.1911+8ee52f99c**. Or you can use the **unstable** [zig-0.14.0 branch](https://github.com/zig-gamedev/zig-gamedev/tree/zig-0.14.0) for newer versions.

[zigup](https://github.com/marler8997/zigup) is recommended for managing compiler versions. To switch to the compiler version after branch checkout:
```sh
Expand All @@ -35,10 +35,10 @@ Alternatively, you can download and install manually using the links below:

| OS/Arch | Download link |
| --------------- | --------------------------- |
| Windows x86_64 | [zig-windows-x86_64-0.13.0-dev.351+64ef45eb0.zip](https://pkg.machengine.org/zig/zig-windows-x86_64-0.13.0-dev.351+64ef45eb0.zip) |
| Linux x86_64 | [zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz](https://pkg.machengine.org/zig/zig-linux-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz) |
| macOS x86_64 | [zig-macos-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz](https://pkg.machengine.org/zig/zig-macos-x86_64-0.13.0-dev.351+64ef45eb0.tar.xz) |
| macOS aarch64 | [zig-macos-aarch64-0.13.0-dev.351+64ef45eb0.tar.xz](https://pkg.machengine.org/zig/zig-macos-aarch64-0.13.0-dev.351+64ef45eb0.tar.xz) |
| Windows x86_64 | [zig-windows-x86_64-0.14.0-dev.1911+8ee52f99c.zip](https://pkg.machengine.org/zig/zig-windows-x86_64-0.14.0-dev.1911+8ee52f99c.zip) |
| Linux x86_64 | [zig-linux-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-linux-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz) |
| macOS x86_64 | [zig-macos-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-macos-x86_64-0.14.0-dev.1911+8ee52f99c.tar.xz) |
| macOS aarch64 | [zig-macos-aarch64-0.14.0-dev.1911+8ee52f99c.tar.xz](https://pkg.machengine.org/zig/zig-macos-aarch64-0.14.0-dev.1911+8ee52f99c.tar.xz) |

### Build and run the [Samples](#sample-applications-native-wgpu)

Expand Down
10 changes: 6 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const std = @import("std");

pub const min_zig_version = std.SemanticVersion{
.major = 0,
.minor = 13,
.minor = 14,
.patch = 0,
.pre = "dev.351",
.pre = "dev.1911",
};

pub fn build(b: *std.Build) void {
Expand Down Expand Up @@ -141,9 +141,11 @@ pub const samples_cross_platform = struct {
pub const instanced_pills_wgpu = @import("samples/instanced_pills_wgpu/build.zig");
pub const layers_wgpu = @import("samples/layers_wgpu/build.zig");
pub const minimal_zgpu_zgui = @import("samples/minimal_zgpu_zgui/build.zig");
pub const monolith = @import("samples/monolith/build.zig");
// TODO(hazeycode): Get monolith building again. See https://github.com/zig-gamedev/zig-gamedev/pull/718
//pub const monolith = @import("samples/monolith/build.zig");
pub const physically_based_rendering_wgpu = @import("samples/physically_based_rendering_wgpu/build.zig");
pub const physics_test_wgpu = @import("samples/physics_test_wgpu/build.zig");
// TODO(hazeycode): Get monolith building again. See https://github.com/zig-gamedev/zig-gamedev/pull/718
//pub const physics_test_wgpu = @import("samples/physics_test_wgpu/build.zig");
pub const procedural_mesh_wgpu = @import("samples/procedural_mesh_wgpu/build.zig");
pub const textured_quad_wgpu = @import("samples/textured_quad_wgpu/build.zig");
pub const triangle_wgpu = @import("samples/triangle_wgpu/build.zig");
Expand Down
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.{
.name = "zig-gamedev",
.version = "0.6.0",
.minimum_zig_version = "0.13.0-dev.351+64ef45eb0",
.minimum_zig_version = "0.14.0",
.paths = .{
"build.zig",
"build.zig.zon",
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0001.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub const display_height = 1024 * 1;
const Vec2 = [2]f32;
const bounds: f32 = 3.0;

var prng = std.rand.DefaultPrng.init(123);
var prng = std.Random.DefaultPrng.init(123);
var random = prng.random();
var pass: u32 = 0;
var y: f32 = -bounds;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0002.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub const display_height = 1024 * 1;
const Vec2 = [2]f32;
const bounds: f32 = 3.0;

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();
var pass: u32 = 0;
var y: f32 = -bounds;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0010.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * 1;

var fs_postprocess: gl.Uint = 0;
var angle: f32 = 0.0;
var prng = std.rand.DefaultPrng.init(123);
var prng = std.Random.DefaultPrng.init(123);
var random = prng.random();

const Particle = struct {
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0011.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub const display_width = 1024 * 1;
pub const display_height = 1024 * 1;

var fs_postprocess: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(123);
var prng = std.Random.DefaultPrng.init(123);
var random = prng.random();

const Particle = struct {
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0012.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub const display_width = 1024 * 1;
pub const display_height = 1024 * 1;

var fs_postprocess: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(123);
var prng = std.Random.DefaultPrng.init(123);
var random = prng.random();

const Particle = struct {
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0013.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub const display_width = 1024 * 1;
pub const display_height = 1024 * 1;

var fs_postprocess: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const Particle = struct {
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0014.zig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var fs_postprocess: gl.Uint = 0;
var angle: f32 = 0.0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0015.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0016.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0017.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0018.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0019.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0020.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0021.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Vec2 = [2]f32;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f32 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0024.zig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub const name = "generative art experiment: x0024";
pub const display_width = 1024 * 1;
pub const display_height = 1024 * 1;

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0025.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * res_mul;

const res_mul = 1; // 1 (1024x1024) or 2 (2048x2048)

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0026.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * res_mul;

const res_mul = 1; // 1 (1024x1024) or 2 (2048x2048)

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0027.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * res_mul;

const res_mul = 1; // 1 (1024x1024) or 2 (2048x2048)

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0028.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * res_mul;

const res_mul = 1; // 1 (1024x1024) or 2 (2048x2048)

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0029.zig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub const display_height = 1024 * res_mul;

const res_mul = 1; // 1 (1024x1024) or 2 (2048x2048)

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

var fs_postprocess: gl.Uint = 0;
Expand Down
2 changes: 1 addition & 1 deletion experiments/genart/src/x0031.zig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Vec2 = [2]f64;
var fs_postprocess: gl.Uint = 0;
var accum_tex: gl.Uint = 0;
var accum_fbo: gl.Uint = 0;
var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
var random = prng.random();

const bounds: f64 = 3.0;
Expand Down
2 changes: 1 addition & 1 deletion libs/zaudio/src/zaudio.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2888,7 +2888,7 @@ test "zaudio.audio_buffer" {
var samples = try std.ArrayList(f32).initCapacity(std.testing.allocator, 1000);
defer samples.deinit();

var prng = std.rand.DefaultPrng.init(0);
var prng = std.Random.DefaultPrng.init(0);
const rand = prng.random();

samples.expandToCapacity();
Expand Down
2 changes: 1 addition & 1 deletion libs/zemscripten/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub fn activateEmsdkStep(b: *std.Build) *std.Build.Step {
.name = "Activate EMSDK",
.owner = b,
.makeFn = &struct {
fn make(_: *std.Build.Step, _: std.Progress.Node) anyerror!void {}
fn make(_: *std.Build.Step, _: std.Build.Step.MakeOptions) anyerror!void {}
}.make,
});
step.dependOn(&chmod_emcc.step);
Expand Down
4 changes: 2 additions & 2 deletions libs/zflecs/src/tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ test "extern struct ABI compatibility" {
if (@TypeOf(ZigType) != type) {
continue;
}
if (comptime std.meta.activeTag(@typeInfo(ZigType)) == .Struct and
@typeInfo(ZigType).Struct.layout == .@"extern")
if (comptime std.meta.activeTag(@typeInfo(ZigType)) == .@"struct" and
@typeInfo(ZigType).@"struct".layout == .@"extern")
{
const flecs_name = if (comptime std.mem.startsWith(u8, decl.name, "Ecs")) decl.name else "ecs_" ++ decl.name;

Expand Down
28 changes: 14 additions & 14 deletions libs/zflecs/src/zflecs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ pub const poly_t = anyopaque;
pub const mixins_t = opaque {};

pub const header_t = extern struct {
magic: i32,
magic: i32 = 0,
type: i32 = 0,
refcount: i32 = 0,
mixins: ?*mixins_t = null,
Expand Down Expand Up @@ -513,9 +513,9 @@ pub const term_t = extern struct {
pub const query_t = extern struct {
hdr: header_t = .{},

terms: [FLECS_TERM_COUNT_MAX]term_t = .{},
sizes: [FLECS_TERM_COUNT_MAX]size_t = .{},
ids: [FLECS_TERM_COUNT_MAX]id_t = .{},
terms: [FLECS_TERM_COUNT_MAX]term_t = .{.{}} ** FLECS_TERM_COUNT_MAX,
sizes: [FLECS_TERM_COUNT_MAX]size_t = .{0} ** FLECS_TERM_COUNT_MAX,
ids: [FLECS_TERM_COUNT_MAX]id_t = .{0} ** FLECS_TERM_COUNT_MAX,

flags: flags32_t = 0,
var_count: i8 = 0,
Expand Down Expand Up @@ -841,7 +841,7 @@ pub const entity_desc_t = extern struct {
symbol: ?[*:0]const u8 = null,
use_low_id: bool = false,
add: ?[*:0]const id_t = null,
set: ?[*:.{}]const value_t = null,
set: ?[*]const value_t = null, // TODO: non-scalar terminator are deprecated in new zig
add_expr: ?[*:0]const u8 = null,
};

Expand Down Expand Up @@ -2436,7 +2436,7 @@ pub fn COMPONENT(world: *world_t, comptime T: type) void {
.size = @sizeOf(T),
.hooks = .{
.dtor = switch (@typeInfo(T)) {
.Struct => if (@hasDecl(T, "dtor")) struct {
.@"struct" => if (@hasDecl(T, "dtor")) struct {
pub fn dtor(ptr: *anyopaque, _: i32, _: *const type_info_t) callconv(.C) void {
T.dtor(@as(*T, @alignCast(@ptrCast(ptr))).*);
}
Expand Down Expand Up @@ -2507,7 +2507,7 @@ pub fn OBSERVER(
// }
fn SystemImpl(comptime fn_system: anytype) type {
const fn_type = @typeInfo(@TypeOf(fn_system));
if (fn_type.Fn.params.len == 0) {
if (fn_type.@"fn".params.len == 0) {
@compileError("System need at least one parameter");
}

Expand All @@ -2516,16 +2516,16 @@ fn SystemImpl(comptime fn_system: anytype) type {
const ArgsTupleType = std.meta.ArgsTuple(@TypeOf(fn_system));
var args_tuple: ArgsTupleType = undefined;

const has_it_param = fn_type.Fn.params[0].type == *iter_t;
const has_it_param = fn_type.@"fn".params[0].type == *iter_t;
if (has_it_param) {
args_tuple[0] = it;
}

const start_index = if (has_it_param) 1 else 0;

inline for (start_index..fn_type.Fn.params.len) |i| {
const p = fn_type.Fn.params[i];
args_tuple[i] = field(it, @typeInfo(p.type.?).Pointer.child, i - start_index).?;
inline for (start_index..fn_type.@"fn".params.len) |i| {
const p = fn_type.@"fn".params[i];
args_tuple[i] = field(it, @typeInfo(p.type.?).pointer.child, i - start_index).?;
}

//NOTE: .always_inline seems ok, but unsure. Replace to .auto if it breaks
Expand All @@ -2541,12 +2541,12 @@ pub fn SYSTEM_DESC(comptime fn_system: anytype) system_desc_t {
var system_desc = system_desc_t{};
system_desc.callback = system_struct.exec;

const fn_type = @typeInfo(@TypeOf(fn_system)).Fn;
const fn_type = @typeInfo(@TypeOf(fn_system)).@"fn";
const has_it_param = fn_type.params[0].type == *iter_t;
const start_index = if (has_it_param) 1 else 0;
inline for (start_index..fn_type.params.len) |i| {
const p = fn_type.params[i];
const param_type_info = @typeInfo(p.type.?).Pointer;
const param_type_info = @typeInfo(p.type.?).pointer;
const inout = if (param_type_info.is_const) .In else .InOut;
system_desc.query.terms[i - start_index] = .{ .id = id(param_type_info.child), .inout = inout };
}
Expand All @@ -2557,7 +2557,7 @@ pub fn SYSTEM_DESC(comptime fn_system: anytype) system_desc_t {
/// Creates system_desc_t from function parameters.
/// Accepts additional query terms
pub fn SYSTEM_DESC_WITH_FILTERS(comptime fn_system: anytype, filters: []const term_t) system_desc_t {
const fn_type = @typeInfo(@TypeOf(fn_system)).Fn;
const fn_type = @typeInfo(@TypeOf(fn_system)).@"fn";
var system_desc = SYSTEM_DESC(fn_system);

const has_it_param = fn_type.params[0].type == *iter_t;
Expand Down
Loading
Loading