diff --git a/src/cmp/cmpbackend-cxx/cmpc-mach.lsp b/src/cmp/cmpbackend-cxx/cmpc-mach.lsp index ad4794e158a0552d2834e5839195ee96797b4f69..0e0dae15369456ee811df3d958335e8540e50f6b 100644 --- a/src/cmp/cmpbackend-cxx/cmpc-mach.lsp +++ b/src/cmp/cmpbackend-cxx/cmpc-mach.lsp @@ -38,12 +38,20 @@ (defun host-type-record (host-type) (ext:if-let ((record (gethash host-type (machine-host-type-hash *machine*)))) record - (cmperr "Not a valid C type name ~A" host-type))) + (if ffi::*ffi-types* + (let ((ffi-type (gethash host-type ffi::*ffi-types*))) + (if ffi-type + (host-type-record ffi-type) + (cmperr "Not a valid FFI type name ~A" host-type))) + (cmperr "Not a valid C type name ~A" host-type)))) + (defun host-type->lisp-type (name) - (let ((output (host-type-record-unsafe name))) - (cond (output - (host-type-lisp-type output)) + (let ((output (host-type-record-unsafe name)) + (ffi-type (when ffi::*ffi-types* + (gethash name ffi::*ffi-types*)))) + (cond (output (host-type-lisp-type output)) + (ffi-type (host-type->lisp-type ffi-type)) ((lisp-type-p name) name) (t (error "Unknown representation type ~S" name)))))