diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/expectations/tests/namespace.rs | 27 | ||||
-rw-r--r-- | tests/headers/namespace.hpp | 9 | ||||
-rw-r--r-- | tests/headers/namespace/nsbegin.h | 1 | ||||
-rw-r--r-- | tests/headers/namespace/nsend.h | 1 |
4 files changed, 35 insertions, 3 deletions
diff --git a/tests/expectations/tests/namespace.rs b/tests/expectations/tests/namespace.rs index 726383d0..dc51640e 100644 --- a/tests/expectations/tests/namespace.rs +++ b/tests/expectations/tests/namespace.rs @@ -1,6 +1,11 @@ /* automatically generated by rust-bindgen */ -#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)] +#![allow( + dead_code, + non_snake_case, + non_camel_case_types, + non_upper_case_globals +)] #[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)] pub mod root { @@ -19,7 +24,7 @@ pub mod root { pub fn in_whatever(); } } - pub mod _bindgen_mod_id_13 { + pub mod _bindgen_mod_id_17 { #[allow(unused_imports)] use self::super::super::root; #[repr(C)] @@ -49,7 +54,7 @@ pub mod root { #[repr(C)] #[derive(Debug)] pub struct C<T> { - pub _base: root::_bindgen_mod_id_13::A, + pub _base: root::_bindgen_mod_id_17::A, pub m_c: T, pub m_c_ptr: *mut T, pub m_c_arr: [T; 10usize], @@ -88,4 +93,20 @@ pub mod root { pub fn barr() -> root::C<f32>; } } + pub mod foobar { + #[allow(unused_imports)] + use self::super::super::root; + extern "C" { + #[link_name = "\u{1}_ZN6foobar3fooEv"] + pub fn foo(); + } + } + pub mod faraway { + #[allow(unused_imports)] + use self::super::super::root; + extern "C" { + #[link_name = "\u{1}_ZN7faraway3barEv"] + pub fn bar(); + } + } } diff --git a/tests/headers/namespace.hpp b/tests/headers/namespace.hpp index 408207f2..a8e6f8ec 100644 --- a/tests/headers/namespace.hpp +++ b/tests/headers/namespace.hpp @@ -40,3 +40,12 @@ namespace w { C<float> barr(); // <- This is the problematic one } + +#define NAMESPACE foobar +namespace NAMESPACE { + void foo(); +} + +#include "namespace/nsbegin.h" +void bar(); +#include "namespace/nsend.h" diff --git a/tests/headers/namespace/nsbegin.h b/tests/headers/namespace/nsbegin.h new file mode 100644 index 00000000..47a51c93 --- /dev/null +++ b/tests/headers/namespace/nsbegin.h @@ -0,0 +1 @@ +namespace faraway { diff --git a/tests/headers/namespace/nsend.h b/tests/headers/namespace/nsend.h new file mode 100644 index 00000000..5c34318c --- /dev/null +++ b/tests/headers/namespace/nsend.h @@ -0,0 +1 @@ +} |