Skip to content
Snippets Groups Projects
Commit 02301098 authored by wlott's avatar wlott
Browse files

Fixed compute-call-form to quote all the types it passes to make-alien,

and to correctly deal with returning pointer-types.
parent e9209f96
No related branches found
No related tags found
No related merge requests found
...@@ -504,7 +504,7 @@ ...@@ -504,7 +504,7 @@
single-float double-float) single-float double-float)
(sub-compute-call-form descr)) (sub-compute-call-form descr))
(null-terminated-string (null-terminated-string
`(alien-access (make-alien ,descr `(alien-access (make-alien ',descr
,(c-type-size return-type) ,(c-type-size return-type)
,(sub-compute-call-form ,(sub-compute-call-form
'system-area-pointer)) 'system-area-pointer))
...@@ -523,11 +523,19 @@ ...@@ -523,11 +523,19 @@
(error "Can't return ~S yet." descr))))) (error "Can't return ~S yet." descr)))))
(record-type (record-type
(error "Can't return ~S yet." (c-type-description return-type))) (error "Can't return ~S yet." (c-type-description return-type)))
((or array-type pointer-type) (pointer-type
(let ((type (pointer-type-to return-type)))
(unless (c-type-size type)
(error "Can't return pointers to objects of unknown size: ~S"
(c-type-description return-type)))
`(make-alien ',(c-type-description type)
,(c-type-size type)
,(sub-compute-call-form 'system-area-pointer))))
(array-type
(unless (c-type-size return-type) (unless (c-type-size return-type)
(error "Can't return arrays of unknown size: ~S" (error "Can't return arrays of unknown size: ~S"
(c-type-description return-type))) (c-type-description return-type)))
`(make-alien ,(c-type-description return-type) `(make-alien ',(c-type-description return-type)
,(c-type-size return-type) ,(c-type-size return-type)
,(sub-compute-call-form 'system-area-pointer)))))) ,(sub-compute-call-form 'system-area-pointer))))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment