diff --git a/lib/isc/include/isc/util.h b/lib/isc/include/isc/util.h index 63d3af340c..e94ac3500e 100644 --- a/lib/isc/include/isc/util.h +++ b/lib/isc/include/isc/util.h @@ -35,6 +35,10 @@ #define __has_attribute(x) 0 #endif /* if !defined(__has_attribute) */ +#if !defined(__has_c_attribute) +#define __has_c_attribute(x) 0 +#endif /* if !defined(__has_c_attribute) */ + #if !defined(__has_feature) #define __has_feature(x) 0 #endif /* if !defined(__has_feature) */ @@ -61,7 +65,9 @@ #define ISC_NONSTRING #endif /* __GNUC__ */ -#if __GNUC__ >= 7 || __has_attribute(fallthrough) +#if __has_c_attribute(fallthrough) +#define FALLTHROUGH [[fallthrough]] +#elif __GNUC__ >= 7 && !defined(__clang__) #define FALLTHROUGH __attribute__((fallthrough)) #else /* clang-format off */