-
Notifications
You must be signed in to change notification settings - Fork 374
C: inject custom code block after includes #211
Copy link
Copy link
Open
Labels
Description
It would be really useful to be able to have a hook after C includes are added (somewhere like https://github.com/eqrion/cbindgen/blob/master/src/bindgen/bindings.rs#L123) but prior to any of the generated type declarations.
Our use case is to have a #ifdef to redefine an opaque handle type, like:
#ifdef WGPU_REMOTE
typedef uint32_t WGPUId;
#else
typedef void *WGPUId;
#endifHowever this needs to occur prior to any of the declarations (because they reference this type), but after includes (because it references uint32_t).
Reactions are currently unavailable