"Attila Lendvai" attila.lendvai@gmail.com writes:
(cffi:define-foreign-type ppoly-t () 'ppoly-t)
Heh, it took me a while to figure out how that even compiled. It creates a PPOLY-T class with to slots: QUOTE and PPOLY-T. I'm not sure how to reliable detect the old syntax. The old DEFINE-FOREIGN-TYPE is more like the new DEFINE-PARSE-METHOD.
previously it worked
(cffi:define-foreign-type _-off-64-t () '_-quad-t) (cffi:define-foreign-type _-quad-t () ':long-long)
(defmacro defctype* (name base-type) "Like DEFCTYPE but defers instantiation until parse-time." `(define-parse-method ,name () (make-instance 'foreign-typedef :name ',name :actual-type (parse-type ',base-type))))
This should work. It could have a few more features of DEFCTYPE's but that's the basic idea. Would Verrazano need this macro added to CFFI or can it define itself somewhere? Also, suggestions for a better name are welcome.
HTH