Robert Bradshaw wrote:
> On Sep 4, 2009, at 7:36 AM, Lisandro Dalcin wrote:
> 
>> On Thu, Sep 3, 2009 at 8:51 AM, Dag Sverre
>> Seljebotn<[email protected]> wrote:
>>> I'm wondering whether we can change this for 0.11.3:
>>>
>>> Currently (if I understand correctly) Cython decides whether you want
>>> C99 complex or Cython complex structs based on whether complex.h is
>>> included or not.
>>>
>> But how the inclusion of "complex.h" is detected ?
> 
> It defines a specific macro.
> 
>>> I think this is a bit too magic. Even if it works, it seems a bit
>>> confusing, and the thing is it won't work if you're interfacing with
>>> functions in C libraries taking complex numbers (which, of course, in
>>> turn include complex.h, but Cython doesn't see that).
>>>
>> I agree...
> 
> If you're working with C libraries that take complex numbers, you've  
> included complex.h somewhere (perhaps indirectly) to use them, right?

I'm sorry, I was confused. I really knew this and forgot .. when I 
posted I thought Cython actually looked for whether it included 
"complex.h" directly.

Since it is pushed to C compilation time there's no issue I think 
(except getting the directives documented on the wiki page).

> However, are you bringing this up because something isn't working for  
> you like it should?

Yes. Fwrap generate pxd files which interface with the Fortran modules 
(which have no header files), potentially using C99 complex numbers. I.e.

cdef extern:
     int myfortranfunc(double complex z)

Just doing

cdef extern from "complex.h": pass

seemed hackish at the time, but now I think it makes perfect sense.

So again, there's no issue here.

(Yes, I think Kurt's looking at emulating complex numbers too but that's 
for later.)

Kurt: I haven't been playing around with it and don't plan to, I just 
suddenly remembered that the issue had to be raised.

-- 
Dag Sverre
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to