Sturla Molden wrote:
> Why is the type declaration there? Even "typedef int const int"  would 
> be bogus. That I am using volatile should not matter. Never typedef 
> native C types to something else.

I think you want to do

cdef extern from *:
     ctypedef int vint "volatile int"

What you said is: typedef "int" as "vint" Cython-side and "volatile int" 
C-side.

What you want to say is: Use an already defined typedef which is named 
"volatile int" C-side.


Dag Sverre


> 
> Sturla Molden
> 
> 
> 
> ctypedef int vint "volatile int"
> 
> cdef class giltest:
> 
>     cdef vint tag, stop, start, missed, switched
>     cdef int num_threads, trials
> 
> 
> Is compiled to:
> 
> 
> /* Type declarations */
> 
> typedef int volatile int;
> 
> /* "D:\giltest.pyx":8
>  *
>  *
>  * cdef class giltest:             # <<<<<<<<<<<<<<
>  *
>  *     cdef vint tag, stop, start, missed, switched
>  */
> 
> struct __pyx_obj_7giltest_giltest {
>   PyObject_HEAD
>   volatile int tag;
>   volatile int stop;
>   volatile int start;
>   volatile int missed;
>   volatile int switched;
>   int num_threads;
>   int trials;
> };
> _______________________________________________
> Cython-dev mailing list
> [email protected]
> http://codespeak.net/mailman/listinfo/cython-dev


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

Reply via email to