Alex Crichton | 8e5f0cd | 2015-09-09 22:46:19 -0700 | [diff] [blame] | 1 | extern crate libc; |
| 2 | extern crate libc_test; |
| 3 | |
Alex Crichton | 1608306 | 2015-09-09 22:59:24 -0700 | [diff] [blame] | 4 | use std::mem; |
| 5 | |
Alex Crichton | a9adfbf | 2015-09-09 23:21:27 -0700 | [diff] [blame] | 6 | use libc::*; |
| 7 | use libc::types::os::common::bsd43::*; |
| 8 | |
Alex Crichton | 3e5155b | 2015-09-09 23:46:19 -0700 | [diff] [blame] | 9 | fn same(rust: u64, c: u64, attr: &str) { |
| 10 | if rust != c { |
| 11 | panic!("bad {}: rust: {} != c {}", attr, rust, c); |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | macro_rules! offset_of { |
| 16 | ($ty:ident, $field:ident) => ( |
| 17 | (&((*(0 as *const $ty)).$field)) as *const _ as u64 |
| 18 | ) |
| 19 | } |
| 20 | |
Alex Crichton | 8e5f0cd | 2015-09-09 22:46:19 -0700 | [diff] [blame] | 21 | #[cfg(test)] |
| 22 | include!(concat!(env!("OUT_DIR"), "/all.rs")); |