Skip to content

Commit ae0fdf7

Browse files
committed
Now that we have stuff that depends on libclang-5 we need to do this.
1 parent fa12451 commit ae0fdf7

18 files changed

+321
-15
lines changed

.travis.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,23 @@ env:
2020
- LLVM_VERSION="3.9.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
2121
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
2222
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
23-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
24-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
2523
- LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
2624
- LLVM_VERSION="4.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
27-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
28-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
29-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="misc"
30-
- LLVM_VERSION="4.0.0" BINDGEN_JOB="quickchecking"
25+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE=
26+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release"
27+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE= BINDGEN_FEATURES="testing_only_extra_assertions"
28+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="test" BINDGEN_PROFILE="--release" BINDGEN_FEATURES="testing_only_extra_assertions"
29+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE=
30+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="integration" BINDGEN_PROFILE="--release"
31+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE=
32+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="expectations" BINDGEN_PROFILE="--release"
33+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="misc"
34+
- LLVM_VERSION="5.0.0" BINDGEN_JOB="quickchecking"
3135

3236
matrix:
3337
fast_finish: true
3438
allow_failures:
35-
- env: LLVM_VERSION=4.0.0 BINDGEN_JOB=rustfmt
39+
- env: LLVM_VERSION=5.0.0 BINDGEN_JOB=rustfmt
3640

3741
cache:
3842
directories:

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ static = []
7171
# on bindgen!
7272
testing_only_docs = []
7373
testing_only_extra_assertions = []
74+
testing_only_libclang_5 = []
7475
testing_only_libclang_4 = []
7576
testing_only_libclang_3_9 = []
7677
testing_only_libclang_3_8 = []

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ environment:
88
- TARGET: gnu
99
LLVM_VERSION: 4.0.0-1
1010
BINDGEN_FEATURES: testing_only_libclang_4
11+
- TARGET: msvc
12+
LLVM_VERSION: 5.0.0-1
13+
BINDGEN_FEATURES: testing_only_libclang_5
1114
- TARGET: msvc
1215
LLVM_VERSION: 3.9.0
1316
BINDGEN_FEATURES: testing_only_libclang_3_9
1417
- TARGET: msvc
1518
LLVM_VERSION: 4.0.0
1619
BINDGEN_FEATURES: testing_only_libclang_4
20+
- TARGET: msvc
21+
LLVM_VERSION: 5.0.0
22+
BINDGEN_FEATURES: testing_only_libclang_5
1723

1824
configuration:
1925
- stable

bindgen-integration/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bindgen = { path = ".." }
1111
gcc = "0.3"
1212

1313
[features]
14+
testing_only_libclang_5 = ["bindgen/testing_only_libclang_5"]
1415
testing_only_libclang_4 = ["bindgen/testing_only_libclang_4"]
1516
testing_only_libclang_3_9 = ["bindgen/testing_only_libclang_3_9"]
1617
testing_only_libclang_3_8 = ["bindgen/testing_only_libclang_3_8"]

tests/expectations/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::io::Write;
99
use std::path::Path;
1010

1111
const LIBCLANG_VERSION_DIRS: &'static [&'static str] =
12-
&["libclang-3.8", "libclang-3.9", "libclang-4"];
12+
&["libclang-3.8", "libclang-3.9", "libclang-4", "libclang-5"];
1313

1414
fn main() {
1515
println!("cargo:rerun-if-changed=build.rs");

tests/expectations/tests/libclang-3.8/call-conv-field.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
#![cfg(not(test))]
56

67

78
#[repr(C)]

tests/expectations/tests/libclang-3.9/call-conv-field.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
#![cfg(not(test))]
56

67

78
#[repr(C)]

tests/expectations/tests/libclang-4/call-conv-field.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33

44
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
#![cfg(not(test))]
56

67

78
#[repr(C)]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
#[repr(C)]
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Foo {
10+
pub _address: u8,
11+
}
12+
pub const Foo_kFoo: bool = true;
13+
#[test]
14+
fn bindgen_test_layout_Foo() {
15+
assert_eq!(
16+
::std::mem::size_of::<Foo>(),
17+
1usize,
18+
concat!("Size of: ", stringify!(Foo))
19+
);
20+
assert_eq!(
21+
::std::mem::align_of::<Foo>(),
22+
1usize,
23+
concat!("Alignment of ", stringify!(Foo))
24+
);
25+
}
26+
#[repr(C)]
27+
#[derive(Debug, Default, Copy, Clone)]
28+
pub struct Bar {
29+
pub _address: u8,
30+
}
31+
extern "C" {
32+
#[link_name = "\u{1}_Z5Test2v"]
33+
pub fn Test2() -> ::std::os::raw::c_uint;
34+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
4+
#![cfg(not(test))]
5+
6+
#[repr(C)]
7+
#[derive(Copy, Clone)]
8+
pub struct JNINativeInterface_ {
9+
pub GetVersion: ::std::option::Option<
10+
unsafe extern "stdcall" fn(env: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
11+
>,
12+
pub __bindgen_padding_0: u32,
13+
pub __hack: ::std::os::raw::c_ulonglong,
14+
}
15+
#[test]
16+
fn bindgen_test_layout_JNINativeInterface_() {
17+
assert_eq!(
18+
::std::mem::size_of::<JNINativeInterface_>(),
19+
16usize,
20+
concat!("Size of: ", stringify!(JNINativeInterface_))
21+
);
22+
assert_eq!(
23+
unsafe { &(*(::std::ptr::null::<JNINativeInterface_>())).GetVersion as *const _ as usize },
24+
0usize,
25+
concat!(
26+
"Offset of field: ",
27+
stringify!(JNINativeInterface_),
28+
"::",
29+
stringify!(GetVersion)
30+
)
31+
);
32+
assert_eq!(
33+
unsafe { &(*(::std::ptr::null::<JNINativeInterface_>())).__hack as *const _ as usize },
34+
8usize,
35+
concat!(
36+
"Offset of field: ",
37+
stringify!(JNINativeInterface_),
38+
"::",
39+
stringify!(__hack)
40+
)
41+
);
42+
}
43+
impl Default for JNINativeInterface_ {
44+
fn default() -> Self {
45+
unsafe { ::std::mem::zeroed() }
46+
}
47+
}
48+
extern "stdcall" {
49+
#[link_name = "\u{1}_bar@0"]
50+
pub fn bar();
51+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
pub const k: bool = true;
8+
#[repr(C)]
9+
#[derive(Debug, Default, Copy, Clone)]
10+
pub struct A {
11+
pub _address: u8,
12+
}
13+
pub const A_k: bool = false;
14+
#[test]
15+
fn bindgen_test_layout_A() {
16+
assert_eq!(
17+
::std::mem::size_of::<A>(),
18+
1usize,
19+
concat!("Size of: ", stringify!(A))
20+
);
21+
assert_eq!(
22+
::std::mem::align_of::<A>(),
23+
1usize,
24+
concat!("Alignment of ", stringify!(A))
25+
);
26+
}
27+
pub type foo = bool;
28+
pub const k2: foo = true;
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
4+
5+
pub const foo: _bindgen_ty_1 = _bindgen_ty_1::foo;
6+
pub const bar: _bindgen_ty_1 = _bindgen_ty_1::bar;
7+
#[repr(u32)]
8+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
9+
pub enum _bindgen_ty_1 {
10+
foo = 4,
11+
bar = 8,
12+
}
13+
pub type EasyToOverflow = ::std::os::raw::c_ulonglong;
14+
pub const k: EasyToOverflow = 2147483648;
15+
pub const k_expr: EasyToOverflow = 0;
16+
pub const BAZ: ::std::os::raw::c_longlong = 24;
17+
pub const fuzz: f64 = 51.;
18+
pub const BAZZ: ::std::os::raw::c_char = 53;
19+
pub const WAT: ::std::os::raw::c_char = 0;
20+
pub const bytestring: &'static [u8; 4usize] = b"Foo\0";
21+
pub const NOT_UTF8: [u8; 5usize] = [240u8, 40u8, 140u8, 40u8, 0u8];
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
8+
pub mod root {
9+
#[allow(unused_imports)]
10+
use self::super::root;
11+
#[repr(C)]
12+
#[derive(Debug, Copy, Clone)]
13+
pub struct Rooted<T> {
14+
pub member: T,
15+
pub _phantom_0: ::std::marker::PhantomData<::std::cell::UnsafeCell<T>>,
16+
}
17+
impl<T> Default for Rooted<T> {
18+
fn default() -> Self {
19+
unsafe { ::std::mem::zeroed() }
20+
}
21+
}
22+
pub type AutoValueVector_Alias = ::std::os::raw::c_int;
23+
#[test]
24+
fn __bindgen_test_layout_Rooted_open0_int_close0_instantiation() {
25+
assert_eq!(
26+
::std::mem::size_of::<root::Rooted<::std::os::raw::c_int>>(),
27+
4usize,
28+
concat!(
29+
"Size of template specialization: ",
30+
stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > )
31+
)
32+
);
33+
assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < :: std :: os :: raw :: c_int > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < :: std :: os :: raw :: c_int > ) ) );
34+
}
35+
#[test]
36+
fn __bindgen_test_layout_Rooted_open0_AutoValueVector_Alias_close0_instantiation() {
37+
assert_eq ! ( :: std :: mem :: size_of :: < root :: Rooted < root :: AutoValueVector_Alias > > ( ) , 4usize , concat ! ( "Size of template specialization: " , stringify ! ( root :: Rooted < root :: AutoValueVector_Alias > ) ) );
38+
assert_eq ! ( :: std :: mem :: align_of :: < root :: Rooted < root :: AutoValueVector_Alias > > ( ) , 4usize , concat ! ( "Alignment of template specialization: " , stringify ! ( root :: Rooted < root :: AutoValueVector_Alias > ) ) );
39+
}
40+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
#![cfg(target_os="macos")]
7+
8+
#[macro_use]
9+
extern crate objc;
10+
#[allow(non_camel_case_types)]
11+
pub type id = *mut objc::runtime::Object;
12+
pub trait Foo {
13+
unsafe fn get(self)
14+
-> *mut ObjectType;
15+
}
16+
impl Foo for id {
17+
unsafe fn get(self) -> *mut ObjectType { msg_send!(self , get) }
18+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
#[repr(C)]
8+
#[derive(Debug, Default, Copy, Clone)]
9+
pub struct Base {
10+
pub _address: u8,
11+
}
12+
#[repr(C)]
13+
#[derive(Debug, Default, Copy, Clone)]
14+
pub struct Derived {
15+
pub b: bool,
16+
}
17+
#[repr(C)]
18+
#[derive(Debug, Default, Copy, Clone)]
19+
pub struct Usage {
20+
pub _address: u8,
21+
}
22+
extern "C" {
23+
#[link_name = "\u{1}_ZN5Usage13static_memberE"]
24+
pub static mut Usage_static_member: [u32; 2usize];
25+
}
26+
#[test]
27+
fn bindgen_test_layout_Usage() {
28+
assert_eq!(
29+
::std::mem::size_of::<Usage>(),
30+
1usize,
31+
concat!("Size of: ", stringify!(Usage))
32+
);
33+
assert_eq!(
34+
::std::mem::align_of::<Usage>(),
35+
1usize,
36+
concat!("Alignment of ", stringify!(Usage))
37+
);
38+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* automatically generated by rust-bindgen */
2+
3+
4+
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
5+
6+
7+
#[repr(C)]
8+
#[derive(Debug, Copy, Clone)]
9+
pub struct Rooted {
10+
pub ptr: MaybeWrapped<::std::os::raw::c_int>,
11+
}
12+
#[test]
13+
fn bindgen_test_layout_Rooted() {
14+
assert_eq!(
15+
::std::mem::size_of::<Rooted>(),
16+
4usize,
17+
concat!("Size of: ", stringify!(Rooted))
18+
);
19+
assert_eq!(
20+
::std::mem::align_of::<Rooted>(),
21+
4usize,
22+
concat!("Alignment of ", stringify!(Rooted))
23+
);
24+
assert_eq!(
25+
unsafe { &(*(::std::ptr::null::<Rooted>())).ptr as *const _ as usize },
26+
0usize,
27+
concat!(
28+
"Offset of field: ",
29+
stringify!(Rooted),
30+
"::",
31+
stringify!(ptr)
32+
)
33+
);
34+
}
35+
impl Default for Rooted {
36+
fn default() -> Self {
37+
unsafe { ::std::mem::zeroed() }
38+
}
39+
}
40+
/// <div rustbindgen replaces="MaybeWrapped"></div>
41+
pub type MaybeWrapped<a> = a;
42+
#[test]
43+
fn __bindgen_test_layout_MaybeWrapped_open0_int_close0_instantiation() {
44+
assert_eq!(
45+
::std::mem::size_of::<MaybeWrapped<::std::os::raw::c_int>>(),
46+
4usize,
47+
concat!(
48+
"Size of template specialization: ",
49+
stringify!(MaybeWrapped<::std::os::raw::c_int>)
50+
)
51+
);
52+
assert_eq!(
53+
::std::mem::align_of::<MaybeWrapped<::std::os::raw::c_int>>(),
54+
4usize,
55+
concat!(
56+
"Alignment of template specialization: ",
57+
stringify!(MaybeWrapped<::std::os::raw::c_int>)
58+
)
59+
);
60+
}

0 commit comments

Comments
 (0)