mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.29k stars 294 forks source link

Generate a unified header file that can be used in both C and C++ #920

Closed SapphireAmoeba5 closed 5 months ago

SapphireAmoeba5 commented 5 months ago

Does cbindgen have the functionality to produce header files that can be used in both C and C++ by using macros to conditionally extern "C" them?

SapphireAmoeba5 commented 5 months ago

Builder::new().with_cpp_compat(true).with_language(Language::C) ... and so on

in build.rs