summaryrefslogtreecommitdiff
path: root/Lisp
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-03-19 14:22:35 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-03-19 14:22:35 +0100
commit5582968976236c4d61bd2377d076c2db0ea17523 (patch)
tree455d34c840bb166579ef22386672071dc5343dd8 /Lisp
parentedd93c244d8e689ce32fa5b77a917dc7fd082561 (diff)
Fix type handling on Mac OS X.
darcs-hash:5d262e23b7c9f6e5f2be206f55fb104693346bcf
Diffstat (limited to 'Lisp')
-rw-r--r--Lisp/type-handling.lisp33
1 files 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))))