-
Notifications
You must be signed in to change notification settings - Fork 717
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for ctypes-prefix, and use-core without libstd.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* automatically generated by rust-bindgen */ | ||
|
||
|
||
#![allow(non_snake_case)] | ||
|
||
#![no_std] | ||
mod libc { pub type c_int = i32; pub enum c_void {} } | ||
|
||
#[repr(C)] | ||
#[derive(Debug, Copy)] | ||
pub struct foo { | ||
pub a: libc::c_int, | ||
pub b: libc::c_int, | ||
pub bar: *mut libc::c_void, | ||
} | ||
#[test] | ||
fn bindgen_test_layout_foo() { | ||
assert_eq!(::core::mem::size_of::<foo>() , 16usize); | ||
assert_eq!(::core::mem::align_of::<foo>() , 8usize); | ||
} | ||
impl Clone for foo { | ||
fn clone(&self) -> Self { *self } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// bindgen-flags: --ctypes-prefix "libc" --use-core --raw-line "#![no_std]" --raw-line "mod libc { pub type c_int = i32; pub enum c_void {} }" | ||
struct foo { | ||
int a, b; | ||
void* bar; | ||
}; |