authorgravatar for gviegas@users.noreply.github.comGustavo C. Viegas <gviegas@users.noreply.github.com> 2024-01-29 23:54:22-03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2024-01-31 02:46:05+02:00
logfc48bbdf90bbfa0ed1f5a95e9e5412351d1df6d7
treeefa1df2d76a100d6aa2762de156c2851f22ffb6a
parentf63f4508d228e37965865221220f4f94103111cf

std.Build.Step.TranslateC: fix use of outdated Module in createModule


1 files changed, 2 insertions(+), 8 deletions(-)

lib/std/Build/Step/TranslateC.zig+2-8
...@@ -87,15 +87,9 @@ pub fn addModule(self: *TranslateC, name: []const u8) *std.Build.Module {...@@ -87,15 +87,9 @@ pub fn addModule(self: *TranslateC, name: []const u8) *std.Build.Module {
87/// current package, but not exposed to other packages depending on this one.87/// current package, but not exposed to other packages depending on this one.
88/// `addModule` can be used instead to create a public module.88/// `addModule` can be used instead to create a public module.
89pub fn createModule(self: *TranslateC) *std.Build.Module {89pub fn createModule(self: *TranslateC) *std.Build.Module {
90 const b = self.step.owner;90 return self.step.owner.createModule(.{
91 const module = b.allocator.create(std.Build.Module) catch @panic("OOM");
92
93 module.* = .{
94 .builder = b,
95 .root_source_file = self.getOutput(),91 .root_source_file = self.getOutput(),
96 .dependencies = std.StringArrayHashMap(*std.Build.Module).init(b.allocator),92 });
97 };
98 return module;
99}93}
10094
101pub fn addIncludeDir(self: *TranslateC, include_dir: []const u8) void {95pub fn addIncludeDir(self: *TranslateC, include_dir: []const u8) void {