diff --git a/tests/expectations/tests/auto.rs b/tests/expectations/tests/auto.rs index 4551f70..f935dfe 100644 --- a/tests/expectations/tests/auto.rs +++ b/tests/expectations/tests/auto.rs @@ -9,7 +9,10 @@ pub struct Foo { pub _address: u8, } -pub const Foo_kFoo: bool = true; +extern "C" { + #[link_name = "_ZN3Foo4kFooE"] + pub static Foo_kFoo: bool; +} #[test] fn bindgen_test_layout_Foo() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( diff --git a/tests/expectations/tests/call-conv-field.rs b/tests/expectations/tests/call-conv-field.rs index d6aa9e4..ec95647 100644 --- a/tests/expectations/tests/call-conv-field.rs +++ b/tests/expectations/tests/call-conv-field.rs @@ -36,7 +36,7 @@ impl Clone for JNINativeInterface_ { impl Default for JNINativeInterface_ { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } -extern "stdcall" { +extern "C" { #[link_name = "_bar@0"] pub fn bar(); } diff --git a/tests/expectations/tests/const_bool.rs b/tests/expectations/tests/const_bool.rs index de9e81b..ba69d2f 100644 --- a/tests/expectations/tests/const_bool.rs +++ b/tests/expectations/tests/const_bool.rs @@ -4,13 +4,19 @@ #![allow(non_snake_case)] -pub const k: bool = true; +extern "C" { + #[link_name = "_ZL1k"] + pub static k: bool; +} #[repr(C)] #[derive(Debug, Default, Copy)] pub struct A { pub _address: u8, } -pub const A_k: bool = false; +extern "C" { + #[link_name = "_ZN1A1kE"] + pub static A_k: bool; +} #[test] fn bindgen_test_layout_A() { assert_eq!(::std::mem::size_of::() , 1usize , concat ! ( @@ -22,4 +28,7 @@ impl Clone for A { fn clone(&self) -> Self { *self } } pub type foo = bool; -pub const k2: foo = true; +extern "C" { + #[link_name = "_ZL2k2"] + pub static k2: foo; +} diff --git a/tests/expectations/tests/constant-evaluate.rs b/tests/expectations/tests/constant-evaluate.rs index ae0570e..d4576f8 100644 --- a/tests/expectations/tests/constant-evaluate.rs +++ b/tests/expectations/tests/constant-evaluate.rs @@ -11,10 +11,31 @@ pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar; pub enum _bindgen_ty_1 { foo = 4, bar = 8, } pub type EasyToOverflow = ::std::os::raw::c_ulonglong; pub const k: EasyToOverflow = 2147483648; -pub const k_expr: EasyToOverflow = 0; -pub const BAZ: ::std::os::raw::c_longlong = 24; -pub const fuzz: f64 = 51.; -pub const BAZZ: ::std::os::raw::c_schar = 53; -pub const WAT: ::std::os::raw::c_schar = 0; -pub const bytestring: &'static [u8; 4usize] = b"Foo\x00"; -pub const NOT_UTF8: [u8; 5usize] = [240, 40, 140, 40, 0]; +extern "C" { + #[link_name = "k_expr"] + pub static k_expr: EasyToOverflow; +} +extern "C" { + #[link_name = "BAZ"] + pub static BAZ: ::std::os::raw::c_longlong; +} +extern "C" { + #[link_name = "fuzz"] + pub static fuzz: f64; +} +extern "C" { + #[link_name = "BAZZ"] + pub static BAZZ: ::std::os::raw::c_schar; +} +extern "C" { + #[link_name = "WAT"] + pub static WAT: ::std::os::raw::c_schar; +} +extern "C" { + #[link_name = "bytestring"] + pub static mut bytestring: *const ::std::os::raw::c_schar; +} +extern "C" { + #[link_name = "NOT_UTF8"] + pub static mut NOT_UTF8: *const ::std::os::raw::c_schar; +}