From eb3af8abe9743669887445f8fc5ff647187f983a Mon Sep 17 00:00:00 2001 From: Richard Reingruber Date: Fri, 28 Apr 2023 06:06:56 +0000 Subject: [PATCH] 8306901: Macro offset_of confuses Eclipse CDT Reviewed-by: stuefe, kbarrett --- src/hotspot/share/utilities/globalDefinitions_gcc.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp index 3da670ef476..11ffe72bd56 100644 --- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp @@ -140,12 +140,12 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } // use offsetof() instead, with the invalid-offsetof warning // temporarily disabled. #define offset_of(klass,field) \ -[]() { \ +([]() { \ char space[sizeof (klass)] ATTRIBUTE_ALIGNED(16); \ klass* dummyObj = (klass*)space; \ char* c = (char*)(void*)&dummyObj->field; \ return (size_t)(c - space); \ -}() +}()) #if defined(_LP64) && defined(__APPLE__)