This has been resolved in Cython (one doesn't even need to specify
c'A' as in Pyrex, though it won't accept multi-character literals).
- Robert
On Feb 22, 2008, at 9:15 AM, Simon Burton wrote:
>
> I have a simple example:
>
> cdef enum foo:
> A = 'A'
> B = 'B'
>
>
> gcc (4.0.3) gives this error:
>
> test.c:46: error: ‘__pyx_k1’ undeclared here (not in a function)
> test.c:48: error: ‘__pyx_k2’ undeclared here (not in a function)
>
> here are the offending lines:
>
> 42
> 43 /* Declarations from test */
> 44
> 45 enum __pyx_t_4test_foo {
> 46 __pyx_e_4test_A = __pyx_k1,
> 47 __pyx_e_4test_B = __pyx_k2
> 48 };
> 49
> 50
> 51
> 52 /* Implementation of test */
> 53
> 54 static char __pyx_k1[] = "A";
> 55 static char __pyx_k2[] = "B";
> 56
>
> There are several problems with this code...
>
> I am basically translating some c code to pyrex, maybe i should
> just put this enum stuff
> in a header and use a cdef extern in my pyrex code.
>
> Any other ideas ?
>
> thanks,
>
> Simon.
>
>
> _______________________________________________
> Pyrex mailing list
> [EMAIL PROTECTED]
> http://lists.copyleft.no/mailman/listinfo/pyrex
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev