mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-15 09:20:23 -07:00
Fix compiled callbacks: order arguments correctly and restore stack in correct state.
This commit is contained in:
parent
fb350f46e8
commit
e4ed682397
1 changed files with 3 additions and 2 deletions
|
|
@ -29,11 +29,11 @@
|
|||
(add-object type))
|
||||
arg-type-constants)))
|
||||
(push (list name c-name (add-object name)
|
||||
return-type arg-types arg-type-constants)
|
||||
return-type (reverse arg-types) (reverse arg-type-constants))
|
||||
*callbacks*)
|
||||
(c1expr
|
||||
`(progn
|
||||
(defun ,name ,arg-variables ,@body)
|
||||
(defun ,name ,(reverse arg-variables) ,@body)
|
||||
(si::put-sysprop ',name :callback
|
||||
(list
|
||||
(ffi:c-inline () () :object
|
||||
|
|
@ -98,6 +98,7 @@
|
|||
ct "," (ffi:size-of-foreign-type type) "));")))
|
||||
(wt-nl "aux = cl_apply_from_stack(" (length arg-types)
|
||||
",ecl_fdefinition(" c-name-constant "));")
|
||||
(wt-nl "cl_stack_pop_n(" (length arg-types) ");")
|
||||
(wt-nl "ecl_foreign_data_set_elt(&output,"
|
||||
(foreign-elt-type-code return-type) ",aux);")
|
||||
(wt-nl "return output;")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue