Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 3 May 2023 11:44:11 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 feature tests 1/6] C23: provide fallbacks for the use of C
 attributes

---
 include/features.h | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/include/features.h b/include/features.h
index 85cfb72a..8e1d84e3 100644
--- a/include/features.h
+++ b/include/features.h
@@ -35,6 +35,26 @@
 #define _Noreturn
 #endif
 
+#ifdef __has_c_attribute
+# if __has_c_attribute(__noreturn__)
+#  define __noreturn [[__noreturn__]]
+# endif
+# if __has_c_attribute(__deprecated__)
+#  define __deprecated [[__deprecated__]]
+# endif
+#endif
+
+#ifndef __noreturn
+# define __noreturn _Noreturn
+#endif
+#ifndef __deprecated
+# if defined(__GNUC__)
+#  define __deprecated __attribute__((__deprecated__))
+# else
+#  define __deprecated
+# endif
+#endif
+
 #define __REDIR(x,y) __typeof__(x) x __asm__(#y)
 
 #endif
-- 
2.34.1

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.