| ... | ... | @@ -42,6 +42,12 @@ fn getOverridenNameNew(value: []const u8) ?[]const u8 { |
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | fn isReservedNameOld(name: []const u8) bool { |
| 46 | return std.mem.startsWith(u8, name, "available") or |
| 47 | std.mem.startsWith(u8, name, "reserved") or |
| 48 | std.mem.startsWith(u8, name, "unused"); |
| 49 | } |
| 50 | |
| 45 | 51 | pub fn main() !void { |
| 46 | 52 | var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); |
| 47 | 53 | defer arena.deinit(); |
| ... | ... | @@ -224,7 +230,7 @@ pub fn main() !void { |
| 224 | 230 | // abi is always o32 |
| 225 | 231 | _ = fields.next() orelse return error.Incomplete; |
| 226 | 232 | const name = fields.next() orelse return error.Incomplete; |
| 227 | | if (mem.startsWith(u8, name, "unused")) continue; |
| 233 | if (isReservedNameOld(name)) continue; |
| 228 | 234 | const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name; |
| 229 | 235 | |
| 230 | 236 | try writer.print(" {p} = linux_base + {s},\n", .{ zig.fmtId(fixed_name), number }); |
| ... | ... | @@ -250,6 +256,7 @@ pub fn main() !void { |
| 250 | 256 | // abi is always n64 |
| 251 | 257 | _ = fields.next() orelse return error.Incomplete; |
| 252 | 258 | const name = fields.next() orelse return error.Incomplete; |
| 259 | if (isReservedNameOld(name)) continue; |
| 253 | 260 | const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name; |
| 254 | 261 | |
| 255 | 262 | try writer.print(" {p} = linux_base + {s},\n", .{ zig.fmtId(fixed_name), number }); |
| ... | ... | @@ -275,6 +282,7 @@ pub fn main() !void { |
| 275 | 282 | // abi is always n32 |
| 276 | 283 | _ = fields.next() orelse return error.Incomplete; |
| 277 | 284 | const name = fields.next() orelse return error.Incomplete; |
| 285 | if (isReservedNameOld(name)) continue; |
| 278 | 286 | const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name; |
| 279 | 287 | |
| 280 | 288 | try writer.print(" {p} = linux_base + {s},\n", .{ zig.fmtId(fixed_name), number }); |
| ... | ... | @@ -351,6 +359,7 @@ pub fn main() !void { |
| 351 | 359 | // abi is always common |
| 352 | 360 | _ = fields.next() orelse return error.Incomplete; |
| 353 | 361 | const name = fields.next() orelse return error.Incomplete; |
| 362 | if (isReservedNameOld(name)) continue; |
| 354 | 363 | const fixed_name = if (stdlib_renames.get(name)) |fixed| fixed else name; |
| 355 | 364 | |
| 356 | 365 | try writer.print(" {p} = {s},\n", .{ zig.fmtId(fixed_name), number }); |