+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
/* 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