diff options
Diffstat (limited to 'runtime/base/macros.h')
-rw-r--r-- | runtime/base/macros.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/runtime/base/macros.h b/runtime/base/macros.h index dc692d2b75..7a293c7a08 100644 --- a/runtime/base/macros.h +++ b/runtime/base/macros.h @@ -138,10 +138,10 @@ char (&ArraySizeHelper(T (&array)[N]))[N]; #define SIZEOF_MEMBER(t, f) sizeof((reinterpret_cast<t*>(4096))->f) #define OFFSETOF_MEMBER(t, f) \ - (reinterpret_cast<const char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<const char*>(16)) // NOLINT + (reinterpret_cast<uintptr_t>(&reinterpret_cast<t*>(16)->f) - static_cast<uintptr_t>(16u)) // NOLINT -#define OFFSETOF_VOLATILE_MEMBER(t, f) \ - (reinterpret_cast<volatile char*>(&reinterpret_cast<t*>(16)->f) - reinterpret_cast<volatile char*>(16)) // NOLINT +#define OFFSETOF_MEMBERPTR(t, f) \ + (reinterpret_cast<uintptr_t>(&(reinterpret_cast<t*>(16)->*f)) - static_cast<uintptr_t>(16)) // NOLINT #define PACKED(x) __attribute__ ((__aligned__(x), __packed__)) |