]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Use __has_attribute for _NETTLE_ATTRIBUTE_PURE, delete _NETTLE_ATTRIBUTE_DEPRECATED.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 12 May 2026 18:03:20 +0000 (20:03 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 12 May 2026 18:03:20 +0000 (20:03 +0200)
ChangeLog
nettle-types.h

index e3e677d465d3017fac657f9887094a7f5989fdda..b7979cf2e78ad835cf244512f73cea17e8cde561 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,13 @@
+2026-05-12  Niels Möller  <nisse@lysator.liu.se>
+
+       * nettle-types.h (_NETTLE_ATTRIBUTE_PURE): Change preprocessor
+       conditionals to use __has_attribute.
+       (_NETTLE_ATTRIBUTE_DEPRECATED): Deleted, no longer used.
+
 2026-05-11  Niels Möller  <nisse@lysator.liu.se>
 
        * aclocal.m4 (LSH_GCC_ATTRIBUTES): Delete macro, based on
-       AC_COMPILE_IF_ELSE, and cpnfig.h define HAVE_GCC_ATTRIBUTE.
+       AC_COMPILE_IF_ELSE, and config.h define HAVE_GCC_ATTRIBUTE.
        Replaced by...
        (NETTLE_C_ATTRIBUTES): Simpler macro, just adding code to config.h
        to define CONSTRUCTOR, NORETURN, PRINTF_STYLE and UNUSED, when
index b4f1c1a0cef5e2929618a8eaad857dfb94ff16c7..0862107940a0a231973dfb4913a3a0f2f2106b47 100644 (file)
 
 /* Attributes we want to use in installed header files, and hence
    can't rely on config.h. */
-#ifdef __GNUC__
-
-#define _NETTLE_ATTRIBUTE_PURE __attribute__((pure))
-#ifndef _NETTLE_ATTRIBUTE_DEPRECATED
-/* Variant without message is supported since gcc-3.1 or so. */
-#define _NETTLE_ATTRIBUTE_DEPRECATED __attribute__((deprecated))
+#ifdef __has_attribute
+# if __has_attribute (__pure__)
+#  define _NETTLE_ATTRIBUTE_PURE __attribute__((__pure__))
+# else
+#  define _NETTLE_ATTRIBUTE_PURE
+# endif
+#else
+# define _NETTLE_ATTRIBUTE_PURE
 #endif
 
-#else /* !__GNUC__ */
-
-#define _NETTLE_ATTRIBUTE_PURE
-#define _NETTLE_ATTRIBUTE_DEPRECATED
-
-#endif /* !__GNUC__ */
-
 #ifdef __cplusplus
 extern "C" {
 #endif