aboutsummaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-06-13 12:59:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2024-06-13 12:59:19 -0400
commit5757a5023c4c4b252c6a0440e14e8efacaa2668b (patch)
treeebeca25fcfef82e133d0893f21bc94ddfa25afcc /compile.c
parent217eb51280dc6e1caf3e393066a9fd084e125190 (diff)
Support loading shared libraries
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compile.c b/compile.c
index 1cf6e5ed..e558f3c5 100644
--- a/compile.c
+++ b/compile.c
@@ -2330,10 +2330,10 @@ CORD compile_statement_header(env_t *env, ast_t *ast)
case Use: {
auto use = Match(ast, Use);
const char *path = use->raw_path;
- if (strncmp(path, "./", 2) == 0 || strncmp(path, "../", 3) == 0) {
- return CORD_all("#include \"", path, ".h\"\n");
+ if (strncmp(path, "./", 2) == 0 || strncmp(path, "../", 3) == 0 || strncmp(path, "~/", 2) == 0 || strncmp(path, "/", 1) == 0) {
+ return CORD_all("#include \"", path, ".tm.h\"\n");
} else {
- return CORD_all("#include <", path, ".h>\n");
+ return CORD_all("#include <tomo/lib", path, ".h>\n");
}
}
default: