Changeset 6054


Ignore:
Timestamp:
Mar 18, 2007, 1:31:27 AM (13 years ago)
Author:
gb
Message:

Define a few foreign structures inside INSTALL-STANDARD-FOREIGN-TYPES
(again); do so via PARSE-FOREIGN-TYPE, since this runs too early for
DEF-FOREIGN-TYPE to have the intended effect.

Transator for :* : don't force the target type to be fully defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/objc-gf/ccl/lib/foreign-types.lisp

    r6052 r6054  
    17481748
    17491749    (def-foreign-type-translator * (to)
    1750       (let* ((to (if (eq to t) *void-foreign-type* (parse-foreign-type to))))
    1751         (ensure-foreign-type-bits to)
    1752         (or (gethash to (ftd-pointer-types *target-ftd*))
     1750      (let* ((ftd *target-ftd*)
     1751             (to (if (eq to t) *void-foreign-type* (parse-foreign-type to ftd))))
     1752        (or (gethash to (ftd-pointer-types ftd))
    17531753            (setf (gethash to (ftd-pointer-types *target-ftd*))
    17541754                  (make-foreign-pointer-type
     
    17911791      (%def-foreign-type :signed-long signed-long-type ftd)
    17921792      (%def-foreign-type :unsigned-long unsigned-long-type ftd))
    1793     ))
    1794 
    1795 
    1796 
    1797 
    1798 
    1799 
     1793    ;;
     1794    ;; Defining the handful of foreign structures that are used
     1795    ;; to build OpenMCL here ensures that all backends see appropriate
     1796    ;; definitions of them.
     1797    ;;
     1798    ;; Don't use DEF-FOREIGN-TYPE here; this often runs too
     1799    ;; early in the cold load for that to work.
     1800    ;;
     1801    (parse-foreign-type
     1802     '(:struct :cdb-datum
     1803       (:data (* t))
     1804       (:size (:unsigned 32)))
     1805     ftd)
     1806    (parse-foreign-type
     1807     '(:struct :dbm-constant
     1808       (:class (:unsigned 32))
     1809       (:pad (:unsigned 32))
     1810       (:value
     1811        (:union nil
     1812         (:s32 (:signed 32))
     1813         (:u32 (:unsigned 32))
     1814         (:single-float :float)
     1815         (:double-float :double))))
     1816     ftd)
     1817    ;; This matches the xframe-list struct definition in
     1818    ;; "ccl:lisp-kernel;constants.h"
     1819    (parse-foreign-type
     1820     '(:struct :xframe-list
     1821       (:this (:* t #|(struct :ucontext)|#))
     1822       (:prev (:* (:struct  :xframe-list))))
     1823    ftd)
     1824  ))
     1825
     1826
     1827
     1828
     1829
     1830
Note: See TracChangeset for help on using the changeset viewer.