diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -12,11 +12,11 @@ #include "../newgrf_roadtype.h" /* Helper for filling property tables */ -#define NIP(prop, base, variable, type, name) { name, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), prop, type } +#define NIP(prop, base, variable, type, name) { name, [] (const void *b) -> const void * { return std::addressof(static_cast(b)->variable); }, cpp_sizeof(base, variable), prop, type } #define NIP_END() { nullptr, 0, 0, 0, 0 } /* Helper for filling callback tables */ -#define NIC(cb_id, base, variable, bit) { #cb_id, (ptrdiff_t)cpp_offsetof(base, variable), cpp_sizeof(base, variable), bit, cb_id } +#define NIC(cb_id, base, variable, bit) { #cb_id, [] (const void *b) -> const void * { return std::addressof(static_cast(b)->variable); }, cpp_sizeof(base, variable), bit, cb_id } #define NIC_END() { nullptr, 0, 0, 0, 0 } /* Helper for filling variable tables */