From b6dc7fc9ffddebce6f04a5349c8f2252c457adf7 Mon Sep 17 00:00:00 2001 From: Josh Junon Date: Sat, 4 Apr 2020 04:04:40 +0200 Subject: [PATCH] publicize member functions affected by #4909 --- lib/std/build.zig | 10 +++++----- lib/std/dwarf.zig | 8 ++++---- lib/std/dynamic_library.zig | 4 ++-- lib/std/json.zig | 2 +- lib/std/pdb.zig | 2 +- lib/std/zig/cross_target.zig | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/std/build.zig b/lib/std/build.zig index 8a38383e87..a7615292ce 100644 --- a/lib/std/build.zig +++ b/lib/std/build.zig @@ -284,11 +284,11 @@ pub const Builder = struct { return run_step; } - fn dupe(self: *Builder, bytes: []const u8) []u8 { + pub fn dupe(self: *Builder, bytes: []const u8) []u8 { return mem.dupe(self.allocator, u8, bytes) catch unreachable; } - fn dupePath(self: *Builder, bytes: []const u8) []u8 { + pub fn dupePath(self: *Builder, bytes: []const u8) []u8 { const the_copy = self.dupe(bytes); for (the_copy) |*byte| { switch (byte.*) { @@ -717,7 +717,7 @@ pub const Builder = struct { return self.invalid_user_input; } - fn spawnChild(self: *Builder, argv: []const []const u8) !void { + pub fn spawnChild(self: *Builder, argv: []const []const u8) !void { return self.spawnChildEnvMap(null, self.env_map, argv); } @@ -843,7 +843,7 @@ pub const Builder = struct { }) catch unreachable; } - fn updateFile(self: *Builder, source_path: []const u8, dest_path: []const u8) !void { + pub fn updateFile(self: *Builder, source_path: []const u8, dest_path: []const u8) !void { if (self.verbose) { warn("cp {} {} ", .{ source_path, dest_path }); } @@ -855,7 +855,7 @@ pub const Builder = struct { }; } - fn pathFromRoot(self: *Builder, rel_path: []const u8) []u8 { + pub fn pathFromRoot(self: *Builder, rel_path: []const u8) []u8 { return fs.path.resolve(self.allocator, &[_][]const u8{ self.build_root, rel_path }) catch unreachable; } diff --git a/lib/std/dwarf.zig b/lib/std/dwarf.zig index fe40a04b9d..ebb4c096f8 100644 --- a/lib/std/dwarf.zig +++ b/lib/std/dwarf.zig @@ -121,7 +121,7 @@ const Die = struct { }; } - fn getAttrString(self: *const Die, di: *DwarfInfo, id: u64) ![]const u8 { + pub fn getAttrString(self: *const Die, di: *DwarfInfo, id: u64) ![]const u8 { const form_value = self.getAttr(id) orelse return error.MissingDebugInfo; return switch (form_value.*) { FormValue.String => |value| value, @@ -389,7 +389,7 @@ pub const DwarfInfo = struct { return self.abbrev_table_list.allocator; } - fn getSymbolName(di: *DwarfInfo, address: u64) ?[]const u8 { + pub fn getSymbolName(di: *DwarfInfo, address: u64) ?[]const u8 { for (di.func_list.span()) |*func| { if (func.pc_range) |range| { if (address >= range.start and address < range.end) { @@ -578,7 +578,7 @@ pub const DwarfInfo = struct { } } - fn findCompileUnit(di: *DwarfInfo, target_address: u64) !*const CompileUnit { + pub fn findCompileUnit(di: *DwarfInfo, target_address: u64) !*const CompileUnit { for (di.compile_unit_list.span()) |*compile_unit| { if (compile_unit.pc_range) |range| { if (target_address >= range.start and target_address < range.end) return compile_unit; @@ -690,7 +690,7 @@ pub const DwarfInfo = struct { return result; } - fn getLineNumberInfo(di: *DwarfInfo, compile_unit: CompileUnit, target_address: usize) !debug.LineInfo { + pub fn getLineNumberInfo(di: *DwarfInfo, compile_unit: CompileUnit, target_address: usize) !debug.LineInfo { var stream = io.fixedBufferStream(di.debug_line); const in = &stream.inStream(); const seekable = &stream.seekableStream(); diff --git a/lib/std/dynamic_library.zig b/lib/std/dynamic_library.zig index 70e26cc71c..65c65292bc 100644 --- a/lib/std/dynamic_library.zig +++ b/lib/std/dynamic_library.zig @@ -33,11 +33,11 @@ const LinkMap = extern struct { pub const Iterator = struct { current: ?*LinkMap, - fn end(self: *Iterator) bool { + pub fn end(self: *Iterator) bool { return self.current == null; } - fn next(self: *Iterator) ?*LinkMap { + pub fn next(self: *Iterator) ?*LinkMap { if (self.current) |it| { self.current = it.l_next; return it; diff --git a/lib/std/json.zig b/lib/std/json.zig index b2b2db6493..1e220d6708 100644 --- a/lib/std/json.zig +++ b/lib/std/json.zig @@ -2336,7 +2336,7 @@ pub const StringifyOptions = struct { /// After a colon, should whitespace be inserted? separator: bool = true, - fn outputIndent( + pub fn outputIndent( whitespace: @This(), out_stream: var, ) @TypeOf(out_stream).Error!void { diff --git a/lib/std/pdb.zig b/lib/std/pdb.zig index 75589b71ff..cd0106034e 100644 --- a/lib/std/pdb.zig +++ b/lib/std/pdb.zig @@ -708,7 +708,7 @@ const MsfStream = struct { return block * self.block_size + offset; } - fn inStream(self: *MsfStream) std.io.InStream(*MsfStream, Error, read) { + pub fn inStream(self: *MsfStream) std.io.InStream(*MsfStream, Error, read) { return .{ .context = self }; } }; diff --git a/lib/std/zig/cross_target.zig b/lib/std/zig/cross_target.zig index 8783ddcb6d..1909a07df0 100644 --- a/lib/std/zig/cross_target.zig +++ b/lib/std/zig/cross_target.zig @@ -660,7 +660,7 @@ pub const CrossTarget = struct { return Target.getObjectFormatSimple(self.getOsTag(), self.getCpuArch()); } - fn updateCpuFeatures(self: CrossTarget, set: *Target.Cpu.Feature.Set) void { + pub fn updateCpuFeatures(self: CrossTarget, set: *Target.Cpu.Feature.Set) void { set.removeFeatureSet(self.cpu_features_sub); set.addFeatureSet(self.cpu_features_add); set.populateDependencies(self.getCpuArch().allFeaturesList());