From 5ba2773f7a2ce6c356a2769d7194e48d9d4824ef Mon Sep 17 00:00:00 2001 From: Sashiri Date: Fri, 15 Oct 2021 00:14:16 +0200 Subject: [PATCH] Migrate from std.builtin to @import("builtin") --- zig-ecs/build.zig | 2 +- zig-ecs/src/ecs/groups.zig | 3 ++- zig-ecs/src/ecs/registry.zig | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/zig-ecs/build.zig b/zig-ecs/build.zig index 3a8c2a2..a59f7c4 100644 --- a/zig-ecs/build.zig +++ b/zig-ecs/build.zig @@ -6,7 +6,7 @@ pub fn build(b: *Builder) void { const build_mode = b.standardReleaseOptions(); // use a different cache folder for macos arm builds - b.cache_root = if (std.builtin.os.tag == .macos and std.builtin.arch == std.builtin.Arch.aarch64) "zig-arm-cache" else "zig-cache"; + b.cache_root = if (builtin.os.tag == .macos and builtin.arch == builtin.Arch.aarch64) "zig-arm-cache" else "zig-cache"; const examples = [_][2][]const u8{ [_][]const u8{ "view_vs_group", "examples/view_vs_group.zig" }, diff --git a/zig-ecs/src/ecs/groups.zig b/zig-ecs/src/ecs/groups.zig index eb746c3..7ae6f6c 100644 --- a/zig-ecs/src/ecs/groups.zig +++ b/zig-ecs/src/ecs/groups.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const builtin = @import("builtin"); const utils = @import("utils.zig"); const Registry = @import("registry.zig").Registry; @@ -156,7 +157,7 @@ pub const OwningGroup = struct { } fn validate(self: OwningGroup, comptime Components: anytype) void { - if (std.builtin.mode == .Debug and self.group_data.owned.len > 0) { + if (builtin.mode == .Debug and self.group_data.owned.len > 0) { std.debug.assert(@typeInfo(Components) == .Struct); inline for (@typeInfo(Components).Struct.fields) |field| { diff --git a/zig-ecs/src/ecs/registry.zig b/zig-ecs/src/ecs/registry.zig index 4d94f32..d982658 100644 --- a/zig-ecs/src/ecs/registry.zig +++ b/zig-ecs/src/ecs/registry.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const builtin = @import("builtin"); const assert = std.debug.assert; const utils = @import("utils.zig"); @@ -506,7 +507,7 @@ pub const Registry = struct { var new_group_data = GroupData.initPtr(self.allocator, self, hash, owned_arr[0..], includes_arr[0..], excludes_arr[0..]); // before adding the group we need to do some checks to make sure there arent other owning groups with the same types - if (std.builtin.mode == .Debug and owned.len > 0) { + if (builtin.mode == .Debug and owned.len > 0) { for (self.groups.items) |grp| { if (grp.owned.len == 0) continue;