summaryrefslogtreecommitdiff
path: root/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.rs')
-rw-r--r--src/macros.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/macros.rs b/src/macros.rs
index 3d1b0e4b..7ec00c86 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -259,6 +259,6 @@ macro_rules! libc_enum {
/// offset of `field` within struct `ty`
macro_rules! offset_of {
($ty:ty, $field:ident) => {
- &(*(0 as *const $ty)).$field as *const _ as usize
+ &(*(ptr::null() as *const $ty)).$field as *const _ as usize
}
}