[Cython] External typedefs and pointers

Dag Sverre Seljebotn dagss at student.matnat.uio.no
Mon Nov 10 11:49:05 CET 2008


Dag Sverre Seljebotn wrote:
> if (sizeof(type_b) != sizeof(long) || ((type_a)-1) != ((type_b)-1) || 
> ((type_a)0.5) != ((type_b)0.5))) { /*raise exception*/ }
>   

Sorry, this should be

if (sizeof(type_b) != sizeof(long) || ((type_b)-1) != ((long)-1) || 
((type_b)0.5) != ((long)0.5))) { /*raise exception*/ }

i.e. it is checked that "type_b" really is exactly a "long" at C 
compilation time.

Dag Sverre




More information about the Cython-dev mailing list