This is a minimal example for reproducing Bug #384.
If you run cargo build
, then the bindings.h
will look like this:
/* Generated with cbindgen:0.9.0 */
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
uint32_t get_x(const dep_struct *dep_struct);
It is missing the dep_struct
type definition:
typedef struct {
uint32_t x;
double y;
} dep_struct;
That is there, when you comment out the macro expansion in the cbindgen.toml
:
[parse.expand]
crates = ["cbindgen-dep"]
This code is based on the minimal example created for mozilla/cbindgen#292, thanks @acfoltzer.