summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2023-02-16 16:16:59 +0000
committerGitHub <noreply@github.com>2023-02-16 16:16:59 +0000
commit40a7ac4546aa3ee8b3bcbf47ea651fc7e6d420c0 (patch)
treebf946f62509625e67636aade62d097b072c51504
parent4816398609ce84e7acc489b6f4b280dc652689df (diff)
parent62d91c5dcbf84bb9cda59996d60ab33df321e9f2 (diff)
-rw-r--r--bindgen-tests/tests/headers/wrap-static-fns.h1
-rw-r--r--bindgen/codegen/mod.rs16
2 files changed, 9 insertions, 8 deletions
diff --git a/bindgen-tests/tests/headers/wrap-static-fns.h b/bindgen-tests/tests/headers/wrap-static-fns.h
index 03892315..faa7b7f1 100644
--- a/bindgen-tests/tests/headers/wrap-static-fns.h
+++ b/bindgen-tests/tests/headers/wrap-static-fns.h
@@ -3,6 +3,7 @@
static inline int foo() {
return 11;
}
+static int bar();
static int bar() {
return 1;
}
diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs
index b6fb70eb..b5a7b27c 100644
--- a/bindgen/codegen/mod.rs
+++ b/bindgen/codegen/mod.rs
@@ -4029,14 +4029,10 @@ impl CodeGenerator for Function {
let is_internal = matches!(self.linkage(), Linkage::Internal);
- if is_internal {
- if ctx.options().wrap_static_fns {
- result.items_to_serialize.push(item.id());
- } else {
- // We can't do anything with Internal functions if we are not wrapping them so just
- // avoid generating anything for them.
- return None;
- }
+ if is_internal && !ctx.options().wrap_static_fns {
+ // We can't do anything with Internal functions if we are not wrapping them so just
+ // avoid generating anything for them.
+ return None;
}
// Pure virtual methods have no actual symbol, so we can't generate
@@ -4139,6 +4135,10 @@ impl CodeGenerator for Function {
abi => abi,
};
+ if is_internal && ctx.options().wrap_static_fns {
+ result.items_to_serialize.push(item.id());
+ }
+
// Handle overloaded functions by giving each overload its own unique
// suffix.
let times_seen = result.overload_number(&canonical_name);