Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <c6a799a745dabb35564c4cfa9975d4b8da93fa27.1685521571.git.Jens.Gustedt@inria.fr>
Date: Wed, 31 May 2023 10:45:48 +0200
From: Jens Gustedt <Jens.Gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: [C23 feature tests 1/4] 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.