Issue #23 resolved

Unable to create bindings to SDL Events

Leonard Ritter
created an issue

CFFI's current limitation of not being able to pass unions as arguments to functions makes it impossible to create bindings for SDL. A core aspect of the library is event handling, and its absence renders SDL worthless.

See here for the offending headers:

the union in question is SDL_Event, which is passed to a handful of core functions, of which SDL_PollEvent() is the most important one, because it is needed to write message loops (see for an example).

the exception is raised during verify(), and reads as such:


File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 269, in verify return self.verifier.load_library() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 55, in load_library self.compile_module() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 42, in compile_module self._write_source() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 95, in _write_source self._vengine.write_source_to_f() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 35, in write_source_to_f self._generate('decl') File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/", line 70, in _generate "not implemented in verify(): %r" % name) VerificationError: not implemented in verify(): 'union SDL_Event' }}}

Comments (2)

  1. Log in to comment