From 5582968976236c4d61bd2377d076c2db0ea17523 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 19 Mar 2008 14:22:35 +0100 Subject: Fix type handling on Mac OS X. darcs-hash:5d262e23b7c9f6e5f2be206f55fb104693346bcf --- Lisp/type-handling.lisp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/Lisp/type-handling.lisp b/Lisp/type-handling.lisp index 73e3107..4cce90c 100644 --- a/Lisp/type-handling.lisp +++ b/Lisp/type-handling.lisp @@ -26,7 +26,8 @@ bit-field-start bit-field-length bit-field-type - array-length) + array-length + unrecognised-tokens) (defun parse-typespec (typestring &optional return-type-p (start 0)) @@ -45,17 +46,27 @@ (otherwise name-and-children)))) (case primary-type ((:bit-field bit-field) - (destructuring-bind (start length type) name-and-children - (make-typespec :primary-type :bit-field - :qualifiers qualifiers - :bit-field-start start - :bit-field-length length - :bit-field-type type))) + (ecase +runtime-type+ + (:gnu (destructuring-bind (start length type) name-and-children + (make-typespec :primary-type :bit-field + :qualifiers qualifiers + :bit-field-start start + :bit-field-length length + :bit-field-type type))) + (:next (destructuring-bind (start length) name-and-children + (make-typespec :primary-type :bit-field + :qualifiers qualifiers + :bit-field-start start + :bit-field-length length))))) ((:array array) (make-typespec :primary-type primary-type :qualifiers qualifiers :array-length (first name-and-children) :children (mapcar #'list->typespec children))) + ((:unrecognised unrecognised) + (make-typespec :primary-type primary-type + :qualifiers qualifiers + :unrecognised-tokens name-and-children)) (otherwise (make-typespec :primary-type primary-type :qualifiers qualifiers @@ -65,15 +76,19 @@ (defun typespec->list (typespec) (with-slots (primary-type qualifiers name children bit-field-start - bit-field-length bit-field-type array-length) + bit-field-length bit-field-type array-length + unrecognised-tokens) typespec `(,primary-type ,qualifiers ,@(when name (list name)) - ,@(when bit-field-start (list bit-field-start)) + ,@(when bit-field-length ;BIT-FIELD-START is NIL on Mac OS X, but + ;we need it regardless. + (list bit-field-start)) ,@(when bit-field-length (list bit-field-length)) ,@(when bit-field-type (list bit-field-type)) ,@(when array-length (list array-length)) + ,@unrecognised-tokens ,@(mapcar #'typespec->list children)))) -- cgit v1.2.3