From db73b0fdc8eb7b190fc7861709112865e39fc923 Mon Sep 17 00:00:00 2001 From: goffioul Date: Fri, 2 Sep 2005 12:45:50 +0000 Subject: [PATCH] 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. --- src/CHANGELOG | 6 ++++++ src/lsp/ffi.lsp | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index 619a3f5ea..6bde6ffc6 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -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 *** diff --git a/src/lsp/ffi.lsp b/src/lsp/ffi.lsp index 810615023..e3a7e1473 100644 --- a/src/lsp/ffi.lsp +++ b/src/lsp/ffi.lsp @@ -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)))