* private.h (ATTRIBUTE_NONSTRING): Also define for Clang 21+.
---
 private.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/private.h b/private.h
index 6a58b073..ee191b4e 100644
--- a/private.h
+++ b/private.h
@@ -539,9 +539,12 @@ typedef unsigned long uintmax_t;
 # define HAVE___HAS_C_ATTRIBUTE false
 #endif
 
-#if 8 <= __GNUC__
-# define ATTRIBUTE_NONSTRING __attribute__((__nonstring__))
-#else
+#ifdef __has_attribute
+# if __has_attribute (nonstring)
+#  define ATTRIBUTE_NONSTRING __attribute__((__nonstring__))
+# endif
+#endif
+#ifndef ATTRIBUTE_NONSTRING
 # define ATTRIBUTE_NONSTRING
 #endif
 
-- 
2.53.0

Reply via email to