cbindgen
cbindgen copied to clipboard
fix: `NonNull<()>` doesn't lower to `void *`
Without the fix, you get something stupid like this:
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef NonNull MyId;
void takes_id(MyId id);
void takes_unit_ptr(void *id);
I'm not sure if there's a smarter fix but I've hit this issue several times. It may need to apply to more types. The only one I can think of that might be a candidate is Box but I haven't seen Box<()> in the wild myself so I didn't include it.