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

@@ -1174,6 +1174,10 @@ parsefile(Parser *p)
advance(p);
continue;
}
/* Stamp the lex's current `// MODULE: foo` directive on the
* decl. cgen uses it to mangle non-exported names so two
* modules can each privately define `cstrlen`/`streq`/etc. */
if (d != NULL) d->module = p->l->module;
if (head == NULL) head = d;
else tail->next = d;
tail = d;