Newer C standards tend to introduce new keywords in the reserved space,
as `_Shiny', and possibly add a macro, tucked away in some header file,
for `shiny'. We already deal with this for `_Bool', `_Complex', and so
on, but adding more is annoying. Add a `:compat' keyword so that the
table initialization machinery can do the work for us.
(defparameter *declspec-map*
(let ((map (make-hash-table :test #'equal)))
(dolist (item '((type :void :char :int :float :double
(defparameter *declspec-map*
(let ((map (make-hash-table :test #'equal)))
(dolist (item '((type :void :char :int :float :double
- (:bool :name "_Bool"))
- (complexity (:complex :name "_Complex")
- (:imaginary :name "_Imaginary"))
+ (:bool :compat "_Bool"))
+ (complexity (:complex :compat "_Complex")
+ (:imaginary :compat "_Imaginary"))
((type :taggedp t) :enum :struct :union)
(size :short :long (:long-long :name "long long"))
(sign :signed :unsigned)
((type :taggedp t) :enum :struct :union)
(size :short :long (:long-long :name "long long"))
(sign :signed :unsigned)
(destructuring-bind (label
&key
(name (string-downcase label))
(destructuring-bind (label
&key
(name (string-downcase label))
(taggedp taggedp))
(if (consp spec) spec (list spec))
(let ((ds (make-instance 'declspec
:label label
(taggedp taggedp))
(if (consp spec) spec (list spec))
(let ((ds (make-instance 'declspec
:label label
:kind kind
:taggedp taggedp)))
(setf (gethash name map) ds
:kind kind
:taggedp taggedp)))
(setf (gethash name map) ds
- (gethash label map) ds))))))
- (dolist (label '(:complex :imaginary :bool))
- (setf (gethash (string-downcase label) map) (gethash label map)))
+ (gethash label map) ds)
+ (when compat
+ (setf (gethash compat map) ds)))))))
map)
"Maps symbolic labels and textual names to `declspec' instances.")
map)
"Maps symbolic labels and textual names to `declspec' instances.")