aboutsummaryrefslogtreecommitdiff
path: root/src/check_decl.cpp
diff options
context:
space:
mode:
authorLaytan Laats <laytanlaats@hotmail.com>2024-07-02 15:28:08 +0200
committerLaytan Laats <laytanlaats@hotmail.com>2024-07-02 15:28:08 +0200
commit6f1cc8071c3ff49c5431cc8ad078d12883f91545 (patch)
treed87348be99cb43cfbd830bedbfdc25aafdda6cc0 /src/check_decl.cpp
parent5637ed9ecdd31929792c59a79d396d24b5bb0ee1 (diff)
wasm: add foreign import and linking of wasm object files
Diffstat (limited to 'src/check_decl.cpp')
-rw-r--r--src/check_decl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp
index 883cfcba9..3c4a4b3de 100644
--- a/src/check_decl.cpp
+++ b/src/check_decl.cpp
@@ -1178,9 +1178,12 @@ gb_internal void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) {
if (foreign_library->LibraryName.paths.count >= 1) {
module_name = foreign_library->LibraryName.paths[0];
}
- name = concatenate3_strings(permanent_allocator(), module_name, WASM_MODULE_NAME_SEPARATOR, name);
+
+ if (!string_ends_with(module_name, str_lit(".o"))) {
+ name = concatenate3_strings(permanent_allocator(), module_name, WASM_MODULE_NAME_SEPARATOR, name);
+ }
}
-
+
e->Procedure.is_foreign = true;
e->Procedure.link_name = name;