Changeset 337


Ignore:
Timestamp:
Jan 19, 2004, 4:37:57 PM (21 years ago)
Author:
Gary Byers
Message:

(Finally) try to handle odd poweropen struct alignment rules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/foreign-types.lisp

    r323 r337  
    985985        (overall-alignment 1)
    986986        (parsed-fields nil)
     987        #+poweropen-target
     988        (first-field-p t)
    987989        (alt-alignment (foreign-record-type-alt-align result)))
    988990    (dolist (field fields)
     
    994996               (alignment (if alt-alignment
    995997                            (min natural-alignment alt-alignment)
     998                            #+poweropen-target
     999                            (if first-field-p
     1000                              (progn
     1001                                (setq first-field-p nil)
     1002                                natural-alignment)
     1003                              (min 32 natural-alignment))
     1004                            #-poweropen-target
    9961005                            natural-alignment))
    9971006               (parsed-field
     
    12811290                        (reduce #'* dims))))))))
    12821291
     1292(defun %find-foreign-record (name)
     1293  (or (info-foreign-type-struct name)
     1294      (info-foreign-type-union name)
     1295      (load-record name)))
     1296
     1297
    12831298(defun %foreign-type-or-record (type)
    12841299  (if (consp type)
    12851300    (parse-foreign-type type)
    1286     (or (info-foreign-type-struct type)
    1287         (info-foreign-type-union type)
    1288         (load-record type)
     1301    (or (%find-foreign-record type)
    12891302        (parse-foreign-type type))))
    1290 
    12911303
    12921304(defun %foreign-type-or-record-size (type &optional (units :bits))
     
    15941606            (ceiling bits 32))))
    15951607       (error "can't determine representation keyword for ~s" f)))))
     1608
     1609(defun foreign-record-accessor-names (record-type &optional prefix)
     1610  (collect ((accessors))
     1611    (dolist (field (foreign-record-type-fields record-type) (accessors))
     1612      (let* ((field-name (append prefix (list (foreign-record-field-name field))))
     1613             (field-type (foreign-record-field-type field)))
     1614        (if (typep field-type 'foreign-record-type)
     1615          (dolist (s (foreign-record-accessor-names field-type field-name))
     1616            (accessors s))
     1617          (accessors field-name))))))
    15961618 
Note: See TracChangeset for help on using the changeset viewer.