X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/3a774b55edfea441c1715994924c2999e9202143..refs/heads/master:/src/c-types-impl.lisp diff --git a/src/c-types-impl.lisp b/src/c-types-impl.lisp index 255a470..e5ead1b 100644 --- a/src/c-types-impl.lisp +++ b/src/c-types-impl.lisp @@ -253,7 +253,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 +292,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).