Fix foreign function return type handling when it is specified with a user-defined foreign type that

is and alias for a foreign primitive type.
This commit is contained in:
goffioul 2005-09-02 12:45:50 +00:00
parent 5b18148e13
commit db73b0fdc8
2 changed files with 9 additions and 3 deletions

View file

@ -19,6 +19,12 @@ ECL 0.9h
initialization files; errors during initialization are intercepted and cause
ECL to abort.
* Foreign function interface (FFI):
- Foreign function return type is now correctly handled, when it is specified
with a user-defined foreign type that is an alias for a primitive type
(M. Goffioul)
;;; Local Variables: ***
;;; mode:text ***
;;; fill-column:79 ***

View file

@ -516,10 +516,10 @@
(return-type (%convert-to-return-type returning))
(nargs (length arguments))
(c-string (produce-function-call c-name nargs))
(casting-required (not (or (member returning '(:void :cstring))
(foreign-elt-type-p returning))))
(casting-required (not (or (member return-type '(:void :cstring))
(foreign-elt-type-p return-type))))
(inline-form `(c-inline ,arguments ,arg-types
,(if casting-required :pointer-void returning)
,(if casting-required :pointer-void return-type)
,c-string
:one-liner t
:side-effects t)))