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 wondering if we can move to a directive-only approach,
>
> No, please... Use the C preprocessor for "activating" the C99 complex
> stuff... This way you have chance that the same generated C source
> could be used with compilers missing C99 complex support...
>
> Of course, you can still use a directive, where the options where {
> yes | no | C-compile-time}, the last based on a preprocessor
> definition...
I think there is already such a directive (though it's not nicely
exposed). The whole thing should be better documented as well.
>> and make C99
>> complex the default?
>>
>
> I bet you use GCC as much as me... However, you always forget that we
> have to live with the nightmare of MSVC compilers being used out
> there... So I think no, C99 complex cannot be the default
Yep, lets not rely on C99, even though all of us developers have it
at our fingertips. Otherwise I would have implemented it this way
from the start...
However, are you bringing this up because something isn't working for
you like it should?
- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev