Appease some UBSan complaints (#720)
This commit is contained in:
@ -80,8 +80,13 @@ int BH_VPRINTF(const char *format, va_list ap);
|
||||
|
||||
/* Return the offset of the given field in the given type */
|
||||
#ifndef offsetof
|
||||
/* GCC 4.0 and later has the builtin. */
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define offsetof(Type, field) __builtin_offsetof(Type, field)
|
||||
#else
|
||||
#define offsetof(Type, field) ((size_t)(&((Type *)0)->field))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef uint8_t uint8;
|
||||
typedef int8_t int8;
|
||||
|
||||
Reference in New Issue
Block a user