I'm working on bringing Claw-Torch up to date. The first problem I ran into when trying to compile the generated bindings file was an error cannot use values types here. The fix is one word:
diff --git a/src/gen/common/util.lisp b/src/gen/common/util.lisp
index 77f79ca..5f058ea 100644
--- a/src/gen/common/util.lisp
+++ b/src/gen/common/util.lisp
@@ -214,7 +214,7 @@
(:function-prototype (%overtype :void))
(:function-prototype-pointer (let ((overriden (%overtype :function-prototype-pointer)))
(if (eq overriden :function-prototype-pointer)
- (%overtype :void)
+ (%overtype :pointer)
(let ((result-type type)
(param-types opts))
(list* overriden
Translating function pointers as :void caused the error when a parameter was of function-pointer type; a parameter can't be void. I poked around CFFI a little and saw evidence that it also translates function pointers as :pointer (though arguably, there should be a distinct type :function-pointer, as C++ does not require them to be the same size as ordinary pointers).
I'm working on bringing Claw-Torch up to date. The first problem I ran into when trying to compile the generated bindings file was an error
cannot use values types here. The fix is one word:Translating function pointers as
:voidcaused the error when a parameter was of function-pointer type; a parameter can't be void. I poked around CFFI a little and saw evidence that it also translates function pointers as:pointer(though arguably, there should be a distinct type:function-pointer, as C++ does not require them to be the same size as ordinary pointers).