cbe: handle underscore prexfix on macos, don't mangle extern function names

This commit is contained in:
kcbanner
2023-11-05 00:27:08 -04:00
parent 192e9a315d
commit 26dabbf301
2 changed files with 5 additions and 1 deletions

View File

@@ -1978,7 +1978,7 @@ pub const DeclGen = struct {
if (mod.decl_exports.get(decl_index)) |exports| {
try writer.print("{ }", .{fmtIdent(mod.intern_pool.stringToSlice(exports.items[export_index].opts.name))});
} else if (decl.getExternDecl(mod).unwrap()) |extern_decl_index| {
try writer.print("{ }", .{fmtIdent(mod.intern_pool.stringToSlice(mod.declPtr(extern_decl_index).name))});
try writer.print("{}", .{mod.declPtr(extern_decl_index).name.fmt(&mod.intern_pool)});
} else {
// MSVC has a limit of 4095 character token length limit, and fmtIdent can (worst case),
// expand to 3x the length of its input, but let's cut it off at a much shorter limit.