diff options
author | Alan Egerton <eggyal@gmail.com> | 2020-06-15 08:32:52 +0100 |
---|---|---|
committer | Alan Egerton <eggyal@gmail.com> | 2020-06-15 21:30:19 +0100 |
commit | 8ea945145b6eb45052f51b776ae33e06ddb6e517 (patch) | |
tree | 153921182a33af98449771ab1674084efce21d63 | |
parent | b54182b055857b203fccb83a4cb6026ac84207f5 (diff) |
Added tests
-rw-r--r-- | bindgen-integration/build.rs | 9 | ||||
-rwxr-xr-x | bindgen-integration/src/lib.rs | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/bindgen-integration/build.rs b/bindgen-integration/build.rs index 38c58497..d106f7cd 100644 --- a/bindgen-integration/build.rs +++ b/bindgen-integration/build.rs @@ -1,7 +1,7 @@ extern crate bindgen; extern crate cc; -use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks}; +use bindgen::callbacks::{MacroParsingBehavior, ParseCallbacks, IntKind}; use bindgen::Builder; use std::collections::HashSet; use std::env; @@ -59,6 +59,13 @@ impl ParseCallbacks for MacroCallback { _ => {} } } + + fn int_macro(&self, _name: &str, _value: i64) -> Option<IntKind> { + Some(IntKind::Custom { + name: "crate::MacroInteger", + is_signed: true, + }) + } } impl Drop for MacroCallback { diff --git a/bindgen-integration/src/lib.rs b/bindgen-integration/src/lib.rs index 8374e208..f8791174 100755 --- a/bindgen-integration/src/lib.rs +++ b/bindgen-integration/src/lib.rs @@ -11,6 +11,8 @@ use std::os::raw::c_int; #[allow(unused)] use bindings::testing::Bar; // This type is generated from module_raw_line. +type MacroInteger = isize; + #[test] fn test_static_array() { let mut test = unsafe { bindings::Test_COUNTDOWN.as_ptr() }; |