Commit b6dc7fc9ff

Josh Junon <josh@junon.me>
2020-04-04 04:04:40
publicize member functions affected by #4909
1 parent 4a5c58d
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());
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;
     }
 
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();
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;
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 {
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 };
     }
 };