1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-08 03:23:01 +00:00

Fix ffi/defbind for non-lazy bindings.

Add testing to bind to symbols in current binary.
This commit is contained in:
Calvin Rose
2022-06-18 10:14:42 -05:00
parent a1aab4008f
commit d803561582
2 changed files with 12 additions and 1 deletions

View File

@@ -3670,7 +3670,7 @@
(defn make-sig []
(ffi/signature :default ret-type ;computed-type-args))
(defn make-ptr []
(assert (ffi/lookup (llib) raw-symbol) "failed to find symbol"))
(assert (ffi/lookup (if lazy (llib) lib) raw-symbol) "failed to find symbol"))
(if lazy
~(defn ,name ,;meta [,;formal-args]
(,ffi/call (,(delay (make-ptr))) (,(delay (make-sig))) ,;formal-args))