Hi Ryan,
On Sun, Oct 18, 2015 at 7:57 PM, Ryan Gonzalez <
rym...@gmail.com> wrote:
>> ffi.cdef(r'typedef signed char INT8, *PINT8;') # error is raised here
> Is this even valid C syntax?
Yes, it is valid C syntax. Mi Zou: you're hitting this problem,
written in cffi/cparser.py:
# Look in the source for what looks like usages of types from the
# list of common types. A "usage" is approximated here as the
# appearance of the word, minus a "definition" of the type, which
# is the last word in a "typedef" statement. Approximative only
# but should be fine for all the common types.
The problem is that the types INT8 and PINT8 are predefined on Windows
and you don't need to redefine them, but you can. If you do, then
normally this is the logic that figures out you're redefining the
types and doesn't include the predefined version. It fails in this
case to figure out that "INT8" is redefined because it only looks for
the word just before the semicolon following a typedef statement.
You can fix it for now by using Ryan's version (or by omitting that
line entirely if you are only building for Windows). I'll try to fix
it inside CFFI.
A bientôt,
Armin.