1. Python CFFI
  2. Untitled project
  3. cffi
  4. Issues
Issue #111 wontfix

#define not recognized

Anonymous created an issue

So I was trying to wrap xlib.h and there is this declaration:

#define Bool int

And if Bool is then used in function prototype or as value in a struct I get: cffi.api.CDefError: cannot parse ...

A possible workaround is to simply replace all uses of Bool with int.

Here is the original script that triggered the error with a very simple test case at the end.

Comments (1)

  1. Armin Rigo

    Yes, #define is not supported in its full generality. You can either replace all Bool with int, or simply replace the #define Bool int line with typedef int Bool;.

  2. Log in to comment