Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Update for latest Zig master #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 7 additions & 10 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,31 @@ const std = @import("std");
pub const Package = struct {
module: *std.Build.Module,

pub fn link(pkg: Package, exe: *std.Build.CompileStep) void {
exe.addModule("zig-metal", pkg.module);
pub fn link(pkg: Package, exe: *std.Build.Step.Compile) void {
exe.root_module.addImport("zig-metal", pkg.module);
}
};

pub fn package(b: *std.Build) Package {
return .{
.module = b.createModule(
.{
.source_file = .{ .path = thisDir() ++ "/src/main.zig" },
.dependencies = &[_]std.build.ModuleDependency{
.{
.name = "zigtrait",
.module = zigTraitModule(b),
},
.root_source_file = .{ .path = thisDir() ++ "/src/main.zig" },
.imports = &.{
.{ .name = "zigtrait", .module = zigTraitModule(b) },
},
},
),
};
}

pub fn zigTraitModule(b: *std.Build) *std.Build.Module {
return b.createModule(.{ .source_file = .{ .path = thisDir() ++ "/libs/zigtrait/src/zigtrait.zig" } });
return b.createModule(.{ .root_source_file = .{ .path = thisDir() ++ "/libs/zigtrait/src/zigtrait.zig" } });
}

pub fn addExample(
b: *std.Build,
target: std.zig.CrossTarget,
target: std.Build.ResolvedTarget,
optimize: std.builtin.OptimizeMode,
comptime name: []const u8,
comptime path: []const u8,
Expand Down
2 changes: 1 addition & 1 deletion src/block.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub fn BlockDescriptor(comptime BlockLiteral: type) type {

pub fn BlockLiteralUserData1(comptime ReturnType: type, comptime T0: type, comptime UserData: type) type {
return extern struct {
isa: *anyopaque = @ptrCast(&_NSConcreteStackBlock),
isa: *anyopaque = @constCast(&_NSConcreteStackBlock),
flags: c_int = 0,
reserved: c_int = 0,
invoke: *const fn (*Self, T0) callconv(.C) ReturnType = undefined,
Expand Down