in src/bindgen/language_backend/clike.rs [989:1011]
fn write_functions<W: Write>(&mut self, out: &mut SourceWriter<W>, b: &Bindings) {
// Override default method to close various blocks containing both globals and functions
// these blocks are opened in [`write_globals`] that is also overridden
if !b.functions.is_empty() || !b.globals.is_empty() {
self.write_functions_default(out, b);
if b.config.cpp_compatible_c() {
out.new_line();
out.write("#ifdef __cplusplus");
}
if b.config.language == Language::Cxx || b.config.cpp_compatible_c() {
out.new_line();
out.write("} // extern \"C\"");
out.new_line();
}
if b.config.cpp_compatible_c() {
out.write("#endif // __cplusplus");
out.new_line();
}
}
}