diff options
author | Christian Poveda Ruiz <31802960+pvdrz@users.noreply.github.com> | 2022-11-02 13:46:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 13:46:22 -0500 |
commit | a673a6bc9b83675a7468379e79dcf5d5659c4623 (patch) | |
tree | 5bf1b4d228bd8ff451d790c85cf4033e49cd9ff2 /bindgen/ir/function.rs | |
parent | 83426897af20d938fb4dca879d54de456ab96d6b (diff) |
Allow callback composition (#2330)
* Allow callback composition
Store all the callbacks added to the builder in a `Vec` so bindgen
invokes each one of them in a last-to-first manner.
Diffstat (limited to 'bindgen/ir/function.rs')
-rw-r--r-- | bindgen/ir/function.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bindgen/ir/function.rs b/bindgen/ir/function.rs index c160ed81..f488b384 100644 --- a/bindgen/ir/function.rs +++ b/bindgen/ir/function.rs @@ -664,10 +664,11 @@ impl ClangSubItemParser for Function { // but seems easy enough to handle it here. name.push_str("_destructor"); } - if let Some(callbacks) = context.parse_callbacks() { - if let Some(nm) = callbacks.generated_name_override(&name) { - name = nm; - } + if let Some(nm) = context + .options() + .last_callback(|callbacks| callbacks.generated_name_override(&name)) + { + name = nm; } assert!(!name.is_empty(), "Empty function name."); |