Skip to content

Commit 8ea9451

Browse files
committed
Added tests
1 parent b54182b commit 8ea9451

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bindgen-integration/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
extern crate bindgen;
22
extern crate cc;
33

4-
use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks};
4+
use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks, IntKind};
55
use bindgen::Builder;
66
use std::collections::HashSet;
77
use std::env;
@@ -59,6 +59,13 @@ impl ParseCallbacks for MacroCallback {
5959
_ => {}
6060
}
6161
}
62+
63+
fn int_macro(&self, _name: &str, _value: i64) -> Option<IntKind> {
64+
Some(IntKind::Custom {
65+
name: "crate::MacroInteger",
66+
is_signed: true,
67+
})
68+
}
6269
}
6370

6471
impl Drop for MacroCallback {

bindgen-integration/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::os::raw::c_int;
1111
#[allow(unused)]
1212
use bindings::testing::Bar; // This type is generated from module_raw_line.
1313

14+
type MacroInteger = isize;
15+
1416
#[test]
1517
fn test_static_array() {
1618
let mut test = unsafe { bindings::Test_COUNTDOWN.as_ptr() };

0 commit comments

Comments
 (0)