File tree 1 file changed +12
-9
lines changed
1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -4677,7 +4677,7 @@ impl CodeGenerator for Function {
4677
4677
4678
4678
let should_wrap = is_internal &&
4679
4679
ctx. options ( ) . wrap_static_fns &&
4680
- link_name_attr. is_none ( ) ;
4680
+ ( link_name_attr. is_none ( ) || utils :: is_cpp ( ctx ) ) ;
4681
4681
4682
4682
if should_wrap {
4683
4683
let name = canonical_name. clone ( ) + ctx. wrap_static_fns_suffix ( ) ;
@@ -5201,6 +5201,15 @@ pub(crate) mod utils {
5201
5201
use std:: path:: PathBuf ;
5202
5202
use std:: str:: FromStr ;
5203
5203
5204
+ pub ( super ) fn is_cpp ( context : & BindgenContext ) -> bool {
5205
+ args_are_cpp ( & context. options ( ) . clang_args ) ||
5206
+ context
5207
+ . options ( )
5208
+ . input_headers
5209
+ . iter ( )
5210
+ . any ( |h| file_is_cpp ( h) )
5211
+ }
5212
+
5204
5213
pub ( super ) fn serialize_items (
5205
5214
result : & CodegenResult ,
5206
5215
context : & BindgenContext ,
@@ -5220,14 +5229,8 @@ pub(crate) mod utils {
5220
5229
std:: fs:: create_dir_all ( dir) ?;
5221
5230
}
5222
5231
5223
- let is_cpp = args_are_cpp ( & context. options ( ) . clang_args ) ||
5224
- context
5225
- . options ( )
5226
- . input_headers
5227
- . iter ( )
5228
- . any ( |h| file_is_cpp ( h) ) ;
5229
-
5230
- let source_path = path. with_extension ( if is_cpp { "cpp" } else { "c" } ) ;
5232
+ let source_path =
5233
+ path. with_extension ( if is_cpp ( context) { "cpp" } else { "c" } ) ;
5231
5234
5232
5235
let mut code = Vec :: new ( ) ;
5233
5236
You can’t perform that action at this time.
0 commit comments