chiark / gitweb /
src/c-types-parse.lisp: Use the new `find-simple-c-type' function.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Jun 2018 18:58:28 +0000 (19:58 +0100)
New simple types added using `define-simple-c-type' won't be present in
the `*declspec-map*', or the `*module-type-map*', so they won't be found
at all using the previous search.  Now, look use `find-simple-c-type' if
the other two lookups don't work.

Now that this works, we don't need `void' or `bool' in the `*declspec-
map*', because they don't accept any modifiers.

src/c-types-parse.lisp

index 13f91452a9c18a37a47a47eeff316b31727fddef..ce70ef7e3cce35efe2c147ec2901062bd347ef42 100644 (file)
@@ -89,8 +89,7 @@   (default-slot (ds 'name slot-names)
 
 (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)
@@ -260,7 +259,8 @@ (defun scan-simple-declspec
                 (let ((kw (token-value scanner)))
                   (or (gethash kw *declspec-map*)
                       (and (boundp '*module-type-map*)
-                           (gethash kw *module-type-map*)))))))
+                           (gethash kw *module-type-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))