I have the following in my library
#define FIXED_LEN_STR 255
typedef char fixed_len_str_t[FIXED_LEN_STR];
In my cdef("""
#define FIXED_LEN_STR ... // This works
typedef char fixed_len_str_t[...]; // this does not work
""")
Is my only choice to explicitly do the following? Is there a better way of doing this?
typedef char fixed_len_str_t[255];
Also, the Error message when it hits the problem is as follows, which doesn't tell me where the error is.
For now I understand this generally means and where to look. But for people with no experience with CFFI,
it would be help full to provide some context or line numbers or something to help locate the point the cdef where this error happens.
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2.6-linux-x86_64.egg/cffi/api.py", line 84, in cdef
self._parser.parse(csource, override=override)
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2.6-linux-x86_64.egg/cffi/cparser.py", line 100, in parse
self._internal_parse(csource)
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2.6-linux-x86_64.egg/cffi/cparser.py", line 137, in _internal_parse
realtype = self._get_type(decl.type, name=
decl.name)
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2.6-linux-x86_64.egg/cffi/cparser.py", line 222, in _get_type
typenode.dim, partial_length_ok=partial_length_ok)
File "/ws/sarvi-sjc/skunkworks/tmproot/lib/python2.6/site-packages/cffi-0.4-py2.6-linux-x86_64.egg/cffi/cparser.py", line 446, in _parse_constant
raise api.FFIError("unsupported non-constant or "
cffi.api.FFIError: unsupported non-constant or not immediately constant expression
Thanks,
Sarvi