;;;# Structure Type
+(defgeneric bare-struct-type-p (foreign-type)
+ (:documentation
+ "Return true if FOREIGN-TYPE is a bare struct type or an alias of a bare struct type. "))
+
+(defmethod bare-struct-type-p ((type foreign-type))
+ "Return true if FOREIGN-TYPE is a bare struct type or an alias of a bare struct type. "
+ nil)
+
(defclass foreign-struct-type (named-foreign-type)
((slots
;; Hash table of slots in this structure, keyed by name.
(defun structure-by-value-p (ctype)
"A structure or union is to be called or returned by value."
- (typep (follow-typedefs (parse-type ctype))
- '(or foreign-struct-type foreign-union-type
- #+cffi::no-long-long emulated-llong-type)))
+ (let ((actual-type (follow-typedefs (parse-type ctype))))
+ (or (and (typep actual-type 'foreign-struct-type)
+ (not (bare-struct-type-p actual-type)))
+ #+cffi::no-long-long (typep actual-type 'emulated-llong-type))))
(defun fn-call-by-value-p (argument-types return-type)
"One or more structures in the arguments or return from the function are called by value."