From 84636fc2af4dfc77b43479909273ebadb4f9b7cb Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Mon, 14 Dec 2020 00:22:04 +0100 Subject: Codechange: Remove all remaining uses of cpp_offset. --- src/stdafx.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/stdafx.h') diff --git a/src/stdafx.h b/src/stdafx.h index e5cb9205f..7ee3ce204 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -392,18 +392,13 @@ static_assert(SIZE_MAX >= UINT32_MAX); */ #define lastof(x) (&x[lengthof(x) - 1]) -#define cpp_offsetof(s, m) (((size_t)&reinterpret_cast((((s*)(char*)8)->m))) - 8) -#if !defined(offsetof) -# define offsetof(s, m) cpp_offsetof(s, m) -#endif /* offsetof */ - /** * Gets the size of a variable within a class. * @param base The class the variable is in. * @param variable The variable to get the size of. * @return the size of the variable */ -#define cpp_sizeof(base, variable) (sizeof(((base*)8)->variable)) +#define cpp_sizeof(base, variable) (sizeof(std::declval().variable)) /** * Gets the length of an array variable within a class. -- cgit v1.2.3-54-g00ecf