[XDK/NTBASEDEF] Use __builtin_offsetof to define FIELD_OFFSET when compiling with clang-cl. CORE-11799 (#94)

This commit is contained in:
Amine Khaldi 2017-10-31 13:54:41 +01:00
parent dde1b98a78
commit 8ffffbb294
No known key found for this signature in database
GPG key ID: DEE3CC0548AE44F1

View file

@ -104,7 +104,7 @@
#endif
/* Returns the byte offset of the specified structure's member */
#ifndef __GNUC__
#if !defined(__GNUC__) && !defined(__clang__)
#define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field))
#else
#define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field))