aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compile.c1
-rw-r--r--tomo.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/compile.c b/compile.c
index 48d0a9ea..caca9aa8 100644
--- a/compile.c
+++ b/compile.c
@@ -1095,7 +1095,6 @@ module_code_t compile_file(ast_t *ast)
return (module_code_t){
.module_name=module_name,
.header=CORD_all(
- "#pragma once\n",
// CORD_asprintf("#line 0 %r\n", Str__quoted(ast->file->filename, false)),
env->code->imports, "\n",
env->code->typedefs, "\n",
diff --git a/tomo.c b/tomo.c
index 914d54db..81eb9088 100644
--- a/tomo.c
+++ b/tomo.c
@@ -115,6 +115,7 @@ int main(int argc, char *argv[])
}
case MODE_TRANSPILE: {
FILE *prog = popen(heap_strf("%s > %s.h", autofmt, f->filename), "w");
+ CORD_put("#pragma once\n", prog);
CORD_put(module.header, prog);
int status = pclose(prog);
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
@@ -131,6 +132,7 @@ int main(int argc, char *argv[])
}
case MODE_EXPANDED_TRANSPILE: {
FILE *prog = popen(heap_strf("%s -x c %s -E - | %s > %s.h", cc, cflags, autofmt, f->filename), "w");
+ CORD_put("#pragma once\n", prog);
CORD_put(module.header, prog);
int status = pclose(prog);
if (WIFEXITED(status) && WEXITSTATUS(status) == 0)