Changeset 10798


Ignore:
Timestamp:
Sep 17, 2008, 10:26:36 PM (11 years ago)
Author:
gb
Message:

new callback-return stuff for Darwin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/ffi-darwinx8632.lisp

    r10493 r10798  
    149149      (format t "~&need to return structure ~s by value" return-type)
    150150      (let* ((return-type-keyword (foreign-type-to-representation-type return-type)))
    151         `(setf (,
    152                 (case return-type-keyword
    153                   (:address '%get-ptr)
    154                   (:signed-doubleword '%%get-signed-longlong)
    155                   (:unsigned-doubleword '%%get-unsigned-longlong)
    156                   (:double-float '%get-double-float)
    157                   (:single-float '%get-single-float)
    158                   (:unsigned-fullword '%get-unsigned-long)
    159                   (t '%get-signed-long)
    160                   ) ,stack-ptr 8) ,result)))))
     151        (ccl::collect ((forms))
     152          (forms 'progn)
     153          (case return-type-keyword
     154            (:single-float
     155             (forms `(setf (%get-unsigned-byte ,stack-ptr -16) 1)))
     156            (:double-float
     157             (forms `(setf (%get-unsigned-byte ,stack-ptr -16) 2))))
     158          (forms
     159           `(setf (,
     160                   (case return-type-keyword
     161                     (:address '%get-ptr)
     162                     (:signed-doubleword '%%get-signed-longlong)
     163                     (:unsigned-doubleword '%%get-unsigned-longlong)
     164                     (:double-float '%get-double-float)
     165                     (:single-float '%get-single-float)
     166                     (:unsigned-fullword '%get-unsigned-long)
     167                     (t '%get-signed-long)
     168                     ) ,stack-ptr -8) ,result))
     169          (forms))))))
    161170
Note: See TracChangeset for help on using the changeset viewer.