You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to add a function to a CEnv environment that returns a struct.
cffi exposes the ffi.new() (doc) function to allow array and struct types to be defined. Otherwise, ffi.cdef won't understand the struct type in the function signature. Is there some good way to pass the struct name to CEnv so that it will be loaded in time for the ffi.cdef of the function signature to catch it?
The text was updated successfully, but these errors were encountered:
I apologize, I was misunderstanding how cffi works. In order to define a custom struct you need to make a cdef call defining the full struct ahead of time.
super.__init__(
...,
c_func_defs=["struct s {int a; float b;};", "struct s func();"]
)
I want to add a function to a CEnv environment that returns a struct.
cffi exposes the
ffi.new()
(doc) function to allow array and struct types to be defined. Otherwise,ffi.cdef
won't understand the struct type in the function signature. Is there some good way to pass the struct name to CEnv so that it will be loaded in time for theffi.cdef
of the function signature to catch it?The text was updated successfully, but these errors were encountered: