(defun structure-by-value-p (ctype)
"A structure or union is to be called or returned by value."
- (member (alexandria:ensure-car ctype) '(:struct :union)))
+ (typep (follow-typedefs (parse-type ctype))
+ '(or foreign-struct-type foreign-union-type
+ #+cffi::no-long-long 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."
8
10
5.0d0)
+
+;;; Typedef fsbv test
+
+(defcfun ("sumpair" sumpair2) :int
+ (p struct-pair-typedef1))
+
+(deftest fsbv.5
+ (sumpair2 '(1 . 2))
+ 3)
+
+;;; Test ulonglong on no-long-long implementations.
+
+(defcfun "ullsum" :unsigned-long-long
+ (a :unsigned-long-long) (b :unsigned-long-long))
+
+(deftest fsbv.6
+ (ullsum #x10DEADBEEF #x2300000000)
+ #x33DEADBEEF)