Work in progress, recovered from old crybaby.
[sod] / src / impl-c-types.lisp
index 7892565..b37833a 100644 (file)
                 (assert (gethash k map))))
             *c-type-intern-map*)))
 
+(defmethod qualify-c-type ((type qualifiable-c-type) qualifiers)
+  (let ((initargs (instance-initargs type)))
+    (remf initargs :qualifiers)
+    (apply (if (gethash type *c-type-intern-map*)
+              #'intern-c-type #'make-instance)
+          (class-of type)
+          :qualifiers (canonify-qualifiers
+                       (append qualifiers (c-type-qualifiers type)))
+          initargs)))
+
 ;;;--------------------------------------------------------------------------
 ;;; Simple C types.
 
                    (keyword (intern (symbol-name kind) :keyword))
                    (constructor (symbolicate 'make- kind '-type)))
               `(progn
-                 (export '(,type ,constructor))
+                 (export '(,type ,kind ,constructor))
                  (defclass ,type (tagged-c-type) ()
                    (:documentation ,(format nil "C ~a types." what)))
                  (defmethod c-tagged-type-kind ((type ,type))