Skip to content

Commit 82ab06c

Browse files
committed
Wasm runtime: add dynlink stubs
1 parent 31d2952 commit 82ab06c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

runtime/wasm/dynlink.wat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,29 @@
1616
;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717

1818
(module
19+
(import "fail" "caml_failwith" (func $caml_failwith (param (ref eq))))
20+
21+
(type $bytes (array (mut i8)))
22+
23+
(@if (>= ocaml_version (5.1.0))
24+
(@then
25+
(func (export "caml_dynlink_open_lib") (param (ref eq)) (result (ref eq))
26+
(call $caml_failwith (@string "Dll.dll_open is not supported"))
27+
(ref.i31 (i32.const 0)))
28+
)
29+
(@else
30+
(func (export "caml_dynlink_open_lib")
31+
(param (ref eq) (ref eq)) (result (ref eq))
32+
(call $caml_failwith (@string "Dll.dll_open is not supported"))
33+
(ref.i31 (i32.const 0)))
34+
))
35+
36+
(func (export "caml_dynlink_close_lib") (param (ref eq)) (result (ref eq))
37+
(call $caml_failwith (@string "Dll.dll_close is not supported"))
38+
(ref.i31 (i32.const 0)))
39+
40+
(func (export "caml_dynlink_lookup_symbol")
41+
(param (ref eq) (ref eq)) (result (ref eq))
42+
(call $caml_failwith (@string "Dll.dll_sym is not supported"))
43+
(ref.i31 (i32.const 0)))
1944
)

0 commit comments

Comments
 (0)