cbindgen
cbindgen copied to clipboard
C and C++ in same header file?
In other C files I've seen things like:
#ifdef __cplusplus
extern "C" {
#endif
void hello_world(char *greeting);
#ifdef __cplusplus
}
#endif
Example: https://github.com/xiallc/PixieSDK/blob/master/sdk/include/pixie16/pixie16.h
Maybe cbindgen could do that?
I believe the cpp_compat flag does what you're suggesting?
My bad. Yes it does!
Hmm, why isn't this enabled by default?
And why isn't this mentioned in the template.toml file?
It's in docs.md tho... But yeah would take a patch to mention in template.toml. As for defaults, mostly historical I believe.
Would it be feasible to change the defaults to enable cpp_compat?