I think there's no reason not to do this, since otherwise it's either extra work for maintainers of the Rust projects (by either creating separate C++ headers, or by creating a TOML file just to set this config), or for C++ users to wrap extern "C" around the #include.
This approach of ifdef'ing __cplusplus is used even in Lua, which is compatible with C89, so I think it's absolutely fine to generate this code, and I wouldn't expect any breakage.
I think there's no reason not to do this, since otherwise it's either extra work for maintainers of the Rust projects (by either creating separate C++ headers, or by creating a TOML file just to set this config), or for C++ users to wrap
extern "C"
around the#include
.This approach of ifdef'ing
__cplusplus
is used even in Lua, which is compatible with C89, so I think it's absolutely fine to generate this code, and I wouldn't expect any breakage.