This change removes obsolete `__GNUC__` version checks at several places.
The minimum supported clang version is 3.5 and that generates __GNUC__
value of 4.
Commit migrated from https://github.com/dotnet/coreclr/commit/
9a870919addaf32de0e6b89e4bf23a893cb42085
// PAL_safe_offsetof is a version of offsetof that protects against an
// overridden operator&
-#if defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 5 || __GNUC__ > 3)
#define FIELD_OFFSET(type, field) __builtin_offsetof(type, field)
#ifndef offsetof
#define offsetof(type, field) __builtin_offsetof(type, field)
#endif
#define PAL_safe_offsetof(type, field) __builtin_offsetof(type, field)
-#else
-#define FIELD_OFFSET(type, field) (((LONG)(LONG_PTR)&(((type *)64)->field)) - 64)
-#ifndef offsetof
-#define offsetof(s,m) ((size_t)((ptrdiff_t)&(((s *)64)->m)) - 64)
-#endif
-#define PAL_safe_offsetof(s,m) ((size_t)((ptrdiff_t)&(char&)(((s *)64)->m))-64)
-#endif
#define CONTAINING_RECORD(address, type, field) \
((type *)((LONG_PTR)(address) - FIELD_OFFSET(type, field)))
#define _UINTPTR_T_DEFINED
#endif
-#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ >= 3))
#define SAFECRT_DEPRECATED __declspec(deprecated)
-#else
-#define SAFECRT_DEPRECATED
-#endif
/* errno_t */
#if !defined(_ERRCODE_DEFINED)
{
#endif // __cplusplus
-#define HIJACK_ON_SIGNAL 1
-
// List of exception types we will be watching for
// NOTE: if you change any of these, you need to adapt s_nMachExceptionPortsMax in thread.hpp
#define PAL_EXC_ILLEGAL_MASK (EXC_MASK_BAD_INSTRUCTION | EXC_MASK_EMULATION)
--*/
void SEHCleanupSignals();
-#if (__GNUC__ > 3 || \
- (__GNUC__ == 3 && __GNUC_MINOR__ > 2))
-// For gcc > 3.2, sjlj exceptions semantics are no longer available
-// Therefore we need to hijack out of signal handlers before second pass
-#define HIJACK_ON_SIGNAL 1
-#endif
-
#endif // !HAVE_MACH_EXCEPTIONS
#endif /* _PAL_SIGNAL_HPP_ */
#define INFTIM -1
#endif // !HAVE_INFTIM
-#if (__GNUC__ >= 4)
#define OffsetOf(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
-#else
-#define OffsetOf(s, f) (INT)(SIZE_T)&(((s*)0)->f)
-#endif /* __GNUC__ version check*/
#undef assert
#define assert (Use__ASSERTE_instead_of_assert) assert