X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/3a774b55edfea441c1715994924c2999e9202143..684d95c7eb6ec755d38efacbc377e9e60ba7044e:/src/c-types-impl.lisp?ds=sidebyside diff --git a/src/c-types-impl.lisp b/src/c-types-impl.lisp index 255a470..7a2ff16 100644 --- a/src/c-types-impl.lisp +++ b/src/c-types-impl.lisp @@ -236,6 +236,7 @@ (setf (gethash ,name *simple-type-map*) ,(car types))) (defctype ,names ,(car types) :export ,export) (define-c-type-syntax ,(car names) (&rest quals) + ,(format nil "Return a possibly-qualified `~A' type." (car types)) `(make-simple-type ,',(car types) (list ,@quals))))))) (export 'find-simple-c-type) @@ -253,7 +254,8 @@ (define-simple-c-type (signed-char schar) "signed char" :export t) (define-simple-c-type wchar-t "wchar_t" :export t) -(define-simple-c-type (int signed signed-int sint) "int" :export t) +(define-simple-c-type (int signed signed-int sint) + ("int" "signed") :export t) (define-simple-c-type (unsigned unsigned-int uint) "unsigned" :export t) (define-simple-c-type (short signed-short short-int signed-short-int sshort) @@ -291,6 +293,19 @@ (define-simple-c-type size-t "size_t" :export t) (define-simple-c-type ptrdiff-t "ptrdiff_t" :export t) +(macrolet ((define-cross-product-types (&rest pieces) + `(progn + ,@(mapcar (lambda (row) + (let* ((c-name (apply #'concatenate 'string row)) + (lisp-name (intern + (frob-identifier c-name)))) + `(define-simple-c-type ,lisp-name ,c-name + :export t))) + (apply #'cross-product pieces))))) + (define-cross-product-types ("int" "uint") ("" "_least" "_fast") + ("8" "16" "32" "64") "_t") + (define-cross-product-types ("int" "uint") ("ptr" "max") "_t")) + ;;;-------------------------------------------------------------------------- ;;; Tagged types (enums, structs and unions).