mirror of
https://github.com/openjdk/jdk.git
synced 2026-06-03 01:02:37 +00:00
8306901: Macro offset_of confuses Eclipse CDT
Reviewed-by: stuefe, kbarrett
This commit is contained in:
parent
d3abfec8b7
commit
eb3af8abe9
@ -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__)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user