diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-04 21:58:45 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-02-04 21:58:45 +0100 |
commit | 800230afe4bab552fb4409432a27307ac1e9fabb (patch) | |
tree | e709170dbf9d2214e06b13b59592eea7cdd6d094 /Lisp/type-handling.lisp | |
parent | 5228a44274871f7367810cfcafed30815b083f9d (diff) |
Parse NeXT-style bit field typespecs properly.
darcs-hash:fb2c911e17afaa24da33c223619fad9fc33bb96b
Diffstat (limited to 'Lisp/type-handling.lisp')
-rw-r--r-- | Lisp/type-handling.lisp | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/Lisp/type-handling.lisp b/Lisp/type-handling.lisp index 0d10560..58adc7e 100644 --- a/Lisp/type-handling.lisp +++ b/Lisp/type-handling.lisp @@ -137,27 +137,38 @@ Returns: (VALUES typespec byte-position string-position)" (prog1 typespec (setq string-position new-str-pos))))) (#\b - (let (bit-field-starting-pos - bit-field-typespec - bit-field-length - byte-position) - (multiple-value-setq (bit-field-starting-pos string-position) - (parse-integer typestring - :start (1+ string-position) - :junk-allowed t)) - (multiple-value-setq (bit-field-typespec - byte-position - string-position) - (parse-typespec typestring nil string-position)) - (multiple-value-setq (bit-field-length string-position) - (parse-integer typestring - :start string-position - :junk-allowed t)) - (list 'bit-field - qualifiers - bit-field-starting-pos - bit-field-length - bit-field-typespec))) + (if (eq +runtime-type+ :gnu) + (let (bit-field-starting-pos + bit-field-typespec + bit-field-length + byte-position) + (multiple-value-setq (bit-field-starting-pos string-position) + (parse-integer typestring + :start (1+ string-position) + :junk-allowed t)) + (multiple-value-setq (bit-field-typespec + byte-position + string-position) + (parse-typespec typestring nil string-position)) + (multiple-value-setq (bit-field-length string-position) + (parse-integer typestring + :start string-position + :junk-allowed t)) + (list 'bit-field + qualifiers + bit-field-starting-pos + bit-field-length + bit-field-typespec)) + (list 'bit-field + qualifiers + nil + (multiple-value-bind (bit-field-length new-string-pos) + (parse-integer typestring + :start (1+ string-position) + :junk-allowed t) + (setq string-position new-string-pos) + bit-field-length) + nil))) (otherwise (prog1 (list (case init-char (#\B :boolean) ;XXX :int? @@ -194,7 +205,11 @@ Returns: (VALUES typespec byte-position string-position)" (#\# 'objective-c-class) (#\: 'selector) (#\* :string) - (#\? :unknown)) + (#\? :unknown) + (otherwise + (prog1 :unrecognised + (push (list :type-specifier init-char) + qualifiers)))) qualifiers) (incf string-position)))) #+(or) ; too greedy (=> bit-fields can't see their length!) |