On Sun, Mar 15, 2009 at 10:10 PM, Tamas K Papp <tkp...@gmail.com> wrote: > I couldn't find anything about C99 complex number types (eg complex > double, complex float) in the CFFI manual, so I guess that they are > not supported at the moment. It it theoretically possible to support > them in CFFI? Is this planned for the future?
I would expect the same sort of issues we have with structs. Regarding structs, for x86, it shouldn't be too hard to hack structs-by-value in, but it's not pretty. I have a first draft for that here: <http://common-lisp.net/~loliveira/patches/more-llong-emulation.diff>. Another option is to add this support to SBCL or whatever your preferred Lisp is. Yet another option is to use GNU Lightning or something similar to setup the arguments ourselves. If you don't need to pass complexes by value, then the following should work for the AMD64 Linux ABI, I didn't check other ABI specs. Untested. (defcstruct (complex-float :conc-name complex-float-) (real :float) (imag :float)) (defcstruct (complex-double :conc-name complex-double-) (real :double) (imag :double)) (define-foreign-type-parser :complex (type) (ecase type (:float 'complex-float) (:double 'complex-double))) -- Luís Oliveira http://student.dei.uc.pt/~lmoliv/ _______________________________________________ cffi-devel mailing list cffi-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel