Ignore:
Timestamp:
Jan 18, 2007, 10:59:42 AM (13 years ago)
Author:
gb
Message:

At least optionally, make structure return explicit (expecting it to
be handled by higher-level code.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/library/parse-ffi.lisp

    r5632 r5718  
    1818
    1919(defvar *parse-ffi-target-ftd* *target-ftd*)
     20(defvar *ffi-struct-return-explicit* nil)
    2021(defvar *ffi-lisp-readtable* (copy-readtable nil))
    2122(defvar *ffi-ordinal* -1)
     
    644645      (setq args (butlast args)))
    645646    (when (ffi-record-type-p retval)
    646       (push retval args)
    647       (push `(:pointer ,retval) (ffi-function-arglist ffi-function))
    648       (setf (ffi-function-return-value ffi-function) *ffi-void-reference*)
    649       (setq retval *ffi-void-reference*))
     647      (if *ffi-struct-return-explicit*
     648        (format t "~& explicit struct return for ~s" ffi-function)
     649        (progn
     650          (push retval args)
     651          (push `(:pointer ,retval) (ffi-function-arglist ffi-function))
     652          (setf (ffi-function-return-value ffi-function) *ffi-void-reference*)
     653          (setq retval *ffi-void-reference*))))
    650654    (dolist (arg args) (ensure-referenced-type-defined arg))
    651655    (ensure-referenced-type-defined retval)
     
    712716         (*target-ftd* ftd)
    713717         (*target-backend* backend)
     718         (*ffi-struct-return-explicit* (getf (ftd-attributes ftd) :struct-return-explicit))
    714719         (d (use-interface-dir dirname ftd))
    715720         (interface-dir (merge-pathnames
Note: See TracChangeset for help on using the changeset viewer.