Commit 3dcde736d012a191cca60e5d5dbd80ef971768e0

Daniel Cheng 2025-02-05T15:18:48

Use __has_attribute to check for __counted_by__ support The initial clang patch to support __counted_by__ was landed and reverted several times. There are some clang toolchains (e.g. the Android toolchain) that report themselves as version 18 but do not support __counted_by__. While it is debatable if Android should be shipping a pre-release clang, using __has_attribute should be a bit simpler overall. Note that this doesn't migrate everything else to use __has_attribute: while clang has always supported __has_attribute, gcc didn't support it until a bit later.