summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-11-30 06:21:44 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-11-30 06:21:44 +0100
commit0916985ad107d8df721460400d7999a4579c817b (patch)
tree63afc53f919a480bde6b5fe0b5b872e036d1d40c
parentd26d89c87dc6f6be1559757c69e6800302cc1cca (diff)
Add a test for the interaction between blacklisting and parse callbacks.
-rw-r--r--bindgen-integration/build.rs7
-rw-r--r--bindgen-integration/cpp/Test.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs
index cadec267..6a38fb86 100644
--- a/bindgen-integration/build.rs
+++ b/bindgen-integration/build.rs
@@ -69,10 +69,15 @@ fn main() {
.enable_cxx_namespaces()
.rustified_enum(".*")
.raw_line("pub use self::root::*;")
+ .raw_line("extern { fn my_prefixed_function_to_remove(i: i32); }")
.module_raw_line("root::testing", "pub type Bar = i32;")
.header("cpp/Test.h")
.clang_args(&["-x", "c++", "-std=c++11"])
- .parse_callbacks(Box::new(MacroCallback {macros: macros.clone(), seen_hellos: Mutex::new(0)}))
+ .parse_callbacks(Box::new(MacroCallback {
+ macros: macros.clone(),
+ seen_hellos: Mutex::new(0),
+ }))
+ .blacklist_function("my_prefixed_function_to_remove")
.generate()
.expect("Unable to generate bindings");
diff --git a/bindgen-integration/cpp/Test.h b/bindgen-integration/cpp/Test.h
index 03a55b88..1299337b 100644
--- a/bindgen-integration/cpp/Test.h
+++ b/bindgen-integration/cpp/Test.h
@@ -195,3 +195,5 @@ struct my_prefixed_bar {
struct my_prefixed_foo {
my_prefixed_bar member;
};
+
+void my_prefixed_function_to_remove();