wcc: c-side mangles private decls; main exempt as entry-point convention

This commit is contained in:
2026-05-11 15:29:29 +09:00
parent 895f221b6c
commit e301a198f4
7 changed files with 153 additions and 25 deletions

View File

@@ -598,11 +598,13 @@ fn collectmods(c: *cgen, file: *node) void = {
if (d.kind == N_FNDECL) {
if (d.exported == 0) {
if (d.module.len > 0) {
let m: *modent = amalloc(c.a, 48u64): *modent;
m.mname = d.str;
m.module = d.module;
m.mnext = c.mods;
c.mods = m;
if (!streq(d.str, "main")) {
let m: *modent = amalloc(c.a, 48u64): *modent;
m.mname = d.str;
m.module = d.module;
m.mnext = c.mods;
c.mods = m;
};
};
};
};