X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/f64eb323a5798e155cc494043f5f750abf50a482..8eb242b160e163a1cfc6e810aeda4788116bba1a:/src/c-types-parse.lisp diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index 6f5db4d..9c33672 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -89,8 +89,7 @@ (defparameter *declspec-map* (let ((map (make-hash-table :test #'equal))) - (dolist (item '((type :void :char :int :float :double - (:bool :compat "_Bool")) + (dolist (item '((type :char :int :float :double) (complexity (:complex :compat "_Complex") (:imaginary :compat "_Imaginary")) ((type :taggedp t) :enum :struct :union) @@ -103,10 +102,8 @@ (if (consp spec) spec (list spec))) (dolist (spec (cdr item)) (destructuring-bind (label - &key - (name (string-downcase label)) - compat - (taggedp taggedp)) + &key (name (string-downcase label)) + compat (taggedp taggedp)) (if (consp spec) spec (list spec)) (let ((ds (make-instance 'declspec :label label @@ -258,9 +255,10 @@ ;; Turns out to be easier to do this by hand. (let ((ds (and (eq (token-type scanner) :id) (let ((kw (token-value scanner))) - (or (and (boundp '*module-type-map*) + (or (gethash kw *declspec-map*) + (and (boundp '*module-type-map*) (gethash kw *module-type-map*)) - (gethash kw *declspec-map*)))))) + (find-simple-c-type kw)))))) (cond ((or (not ds) (and predicate (not (funcall predicate ds)))) (values (list indicator) nil nil)) ((and (typep ds 'declspec) (ds-taggedp ds)) @@ -402,7 +400,7 @@ (disallow-keyword-functions (type) (when (typep type 'c-keyword-function-type) (error "Functions with keyword arguments are only ~ - allowed at top-level."))) + allowed at top-level"))) (star () ;; Prefix: `*' qualifiers