Skip to content

Commit

Permalink
fix compilation with Zig > 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Jun 23, 2024
1 parent 75d0196 commit 71f1172
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
jobs:
build:
strategy:
fail-fast: false
matrix:
zig-version: [master]
os: [ubuntu-latest, macos-latest]
Expand Down
4 changes: 2 additions & 2 deletions src/base.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ fn StaticStringMap(comptime T: type) type {
}
}

fn staticStringMapInitComptime(comptime T: type, comptime kvs_list: anytype) type {
fn staticStringMapInitComptime(comptime T: type, comptime kvs_list: anytype) StaticStringMap(T) {
const static_string_map_renamed_zig_version = std.SemanticVersion.parse("0.13.0-dev.33+8af59d1f9") catch unreachable;
if (@import("builtin").zig_version.order(static_string_map_renamed_zig_version) == .lt) {
@setEvalBranchQuota(kvs_list.len * kvs_list.len);
Expand Down Expand Up @@ -1447,7 +1447,7 @@ pub fn EnumCustomStringValues(comptime T: type, comptime contains_empty_enum: bo
break :build_kvs kvs_array;
};

const enum_from_string_map: StaticStringMap(void) = staticStringMapInitComptime(T, kvs);
const enum_from_string_map: StaticStringMap(T) = staticStringMapInitComptime(T, kvs);

pub fn eql(a: T, b: T) bool {
const tag_a = std.meta.activeTag(a);
Expand Down

0 comments on commit 71f1172

Please sign in to comment.