Dieter Maurer, 29.06.2012 11:25:
> I have
> 
> cdef extern from *:
>         ctypedef char const_unsigned_char "const unsigned char"

This is an incorrect declaration. "char" != "unsigned char".


> cdef const_unsigned_char *c_data = data
> 
> leads to "Cannot convert Python object to 'const_unsigned_char *'"
> while "cdef char *c_data = data" works.
> 
> Should the "ctypedef char const_unsigned_char" not ensure
> that "char" and "const_unsigned_char" are used as synonyms?

I assume you are not using the latest Cython (0.17pre) from github, are
you? It should have a fix for this.

Also note that libc.string contains declarations for "const char*" and friends.

Stefan
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to