ffi: Fix callouts that return a struct or union.
authorMatt Birkholz <puck@birchwood-abbey.net>
Thu, 3 Sep 2015 20:17:46 +0000 (13:17 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Thu, 3 Sep 2015 20:17:46 +0000 (13:17 -0700)
I missed a hunk while porting Peter Feigl <craven@gmx.net>'s patch to
commit cf1e855.

src/ffi/generator.scm

index 7c6523da3a2c3b9db1e8e2e258aaa0bbd272260b..c06c25661d43bbce87e58695179a2c90515d6536 100644 (file)
@@ -223,7 +223,10 @@ Scm_"name" (void)
 
 (define (callout-inits ret-ctype params includes)
   ;; Returns a multi-line string in C syntax for the Init section.
-  (let* ((alien-ret-arg? (ctype/pointer? (definite-ctype ret-ctype includes)))
+  (let* ((alien-ret-arg? (let ((definite (definite-ctype ret-ctype includes)))
+                          (or (ctype/pointer? definite)
+                              (ctype/struct? definite)
+                              (ctype/union? definite))))
         (nargs
          ;; (c-call 1:alien-function 2:ret-alien 3:arg1)
          ;; (c-call 1:alien-function 2:arg1)