]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/attr.h: __has_c_attribute(): Define fallback
authorAlejandro Colomar <alx@kernel.org>
Thu, 7 Aug 2025 12:24:13 +0000 (14:24 +0200)
committerSerge Hallyn <serge@hallyn.com>
Sat, 18 Oct 2025 19:08:47 +0000 (14:08 -0500)
This allows using __has_c_attribute() in compilers that don't have it.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/attr.h

index d7237722dc497c12015fc036fe3ba576f6a8bcb3..2dce1411419dd97a9cbd968454d00e80b3774c85 100644 (file)
@@ -5,6 +5,11 @@
 #include "config.h"
 
 
+#if !defined(__has_c_attribute)
+# define __has_c_attribute(x)  0
+#endif
+
+
 #if (__GNUC__ >= 10)
 # define MAYBE_UNUSED                [[gnu::unused]]
 # define NORETURN                    [[gnu::__noreturn__]]