zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit fc48bbdf90bbfa0ed1f5a95e9e5412351d1df6d7 (tree)
parent f63f4508d228e37965865221220f4f94103111cf
Author: Gustavo C. Viegas <gviegas@users.noreply.github.com>
Date:   Mon, 29 Jan 2024 23:54:22 -0300

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

Diffstat:
Mlib/std/Build/Step/TranslateC.zig | 10++--------
1 file changed, 2 insertions(+), 8 deletions(-)

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