Skip to content

Cannot wrap liballegro event #6

@philomelus

Description

@philomelus

I try this

`
CL-USER> (ql:quickload "cl-liballegro")
To load "cl-liballegro":
Load 1 ASDF system:
cl-liballegro
; Loading "cl-liballegro"
..................
("cl-liballegro")
CL-USER> (ql:quickload "cffi-object")
To load "cffi-object":
Load 1 ASDF system:
cffi-object
; Loading "cffi-object"

("cffi-object")
CL-USER> (cffi-object:define-cobject-class (event (:union cl-liballegro:event)))
`

And I get this:

`
debugger invoked on a CFFI-OBJECT::COBJECT-CLASS-DEFINITION-NOT-FOUND-ERROR in thread
#<THREAD tid=138683 "main thread" RUNNING {1201638093}>:
Cannot find the CFFI object class for type ANY-EVENT.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.

(CFFI-OBJECT::FIND-COBJECT-CLASS-DEFINITION #<CL-LIBALLEGRO::ANY-EVENT-TCLASS CL-LIBALLEGRO:ANY-EVENT>)
error finding frame source: Bogus form-number: the source file has probably
changed too much to cope with.
source: NIL
`

The code for it in cl-liballegro is:

`(defcunion event
(type event-type)
(any (:struct any-event))
(display (:struct display-event))
(joystick (:struct joystick-event))
(keyboard (:struct keyboard-event))
(mouse (:struct mouse-event))
(timer (:struct timer-event))
(touch (:struct touch-event))
(user (:struct user-event))
(audio-record-event (:struct audio-recorder-event)))

`

The code is contained within the same file as all the other events that are members of the cl-liballegro::event union, so I have no idea what to do to resolve.

If I attempt this:

CL-USER\> (cffi-object:define-cobject-class (any-event (:struct cl-liballegro::any-event)))

I get a successful this:

`#S(CFFI-OBJECT::COBJECT-CLASS-DEFINITION
:CLASS ANY-EVENT
:INTERNAL-CONSTRUCTOR %%%MAKE-ANY-EVENT
:CONSTRUCTOR MAKE-ANY-EVENT
:IN-PLACE-CONSTRUCTOR %%MAKE-ANY-EVENT
:SLOT-ACCESSORS ((TYPE . ANY-EVENT-TYPE)
(CL-LIBALLEGRO::SOURCE . ANY-EVENT-SOURCE)
(CL-LIBALLEGRO::TIMESTAMP . ANY-EVENT-TIMESTAMP))
:COPIER COPY-ANY-EVENT
:PREDICATE ANY-EVENT-P
:EQUALITY-COMPARATOR ANY-EVENT-EQUAL)

`

I'm no where near fluent enough in common lisp to fix this without help, so any help is greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions