Skip to content

Error: "cannot use values types here" #17

Description

@slburson

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions