mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Only use __builtin_offsetof on GCC 4+. It is not supported in GCC 3 or earlier.
This commit is contained in:
@@ -828,7 +828,7 @@ decouple library dependencies with standard string, memory and so on.
|
||||
#endif
|
||||
|
||||
#ifndef OFFSETOF
|
||||
#if defined(__clang__) || defined(__GNUC__)
|
||||
#if defined(__clang__) || (__GNUC__ >= 4)
|
||||
#define OFFSETOF(type, field) __builtin_offsetof(type, field)
|
||||
#else
|
||||
#define OFFSETOF(type, field) ((size_t)&(((type *)0)->field))
|
||||
|
Reference in New Issue
Block a user