summaryrefslogtreecommitdiff
path: root/nix-test/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'nix-test/src/lib.rs')
-rw-r--r--nix-test/src/lib.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/nix-test/src/lib.rs b/nix-test/src/lib.rs
index 25ab7fc7..cfe7b798 100644
--- a/nix-test/src/lib.rs
+++ b/nix-test/src/lib.rs
@@ -42,6 +42,8 @@ pub fn assert_size_of<T>(name: &str) {
}
}
+pub use ffi::get_int_const;
+
pub trait GetConst : PartialEq<Self> + fmt::Display {
unsafe fn get_const(name: *const c_char) -> Self;
}
@@ -51,3 +53,9 @@ impl GetConst for c_int {
ffi::get_int_const(name)
}
}
+
+impl GetConst for u32 {
+ unsafe fn get_const(name: *const c_char) -> u32 {
+ ffi::get_int_const(name) as u32
+ }
+}