diff --git a/include/msvcrt/stddef.h b/include/msvcrt/stddef.h index 0ceb65d91cd..cc38d569177 100644 --- a/include/msvcrt/stddef.h +++ b/include/msvcrt/stddef.h @@ -28,7 +28,9 @@ #endif #endif -#ifdef _WIN64 +#ifdef __GNUC__ +#define offsetof(s,m) __builtin_offsetof(s,m) +#elif defined(_WIN64) #define offsetof(s,m) (size_t)((ptrdiff_t)&(((s*)NULL)->m)) #else #define offsetof(s,m) (size_t)&(((s*)NULL)->m)