-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNORE_DECLARATIONS: Usage? #5
Comments
The idea is that the standard types are already understood by cython, which is why |
That makes perfect sense. I am new on Cython, but as far as I can tell from the documentation, these types are not standard Cython types. Perhaps it depends on the build, like size_t was available for me.
With the pyx: cdef extern from "components/offset_filter.h":
ctypedef bool Comp_Success
ctypedef void* Comp_Instance
cdef enum If_Config:
If_SyncedScan_programCapacity
If_SyncedScan_jobCapacity
If_Frame_syncedCapacity
If_Signals_signalCapacity
If_TrackedObject_Array_capacity
cdef struct If_Signal_Array:
size_t count
uint16_t items[1]
cdef struct If_Signals:
If_Signal_Array signal
uint_fast16_t timestamp
Comp_Success Comp_SignalFilter_SignalsIn(Comp_Instance instance, If_Signals* signal)
Comp_Success Comp_SignalFilter_SignalsOut(Comp_Instance instance, If_Signals* signal)
void Comp_OffsetFilter_Run(Comp_Instance instance)
If_Signal_Array* Comp_OffsetFilter_signalOffsets(Comp_Instance instance) |
I understand
IGNORE_DECLARATIONS
prunes typedefs from_fake_typedefs.h
, which are anyway deliberately incorrect (fake). But that leaves my cython declarations with undeclared data types:I still need those types to be declared. They can be dummy since the cython generated c code will include the correct headers. By removing the used types in
IGNORE_DECLARATIONS
, it almost works:_Bool
needs to be replaced bybint
, so I added filter for that inparse()
. I noticed by accident thatsize_t
is understood by Cython, but that is undocumented so probably best to typedef toint
An alternative is to manually prepend the generated pxd with:
It seems I am missing some step here. What is the intended usage for dealing with standard types?
The text was updated successfully, but these errors were encountered: