dnl roken. The HAVE___ATTRIBUTE__ symbol is not used in the OpenAFS code.
dnl
AC_DEFUN([OPENAFS_C_ATTRIBUTE], [
+ AX_GCC_FUNC_ATTRIBUTE([always_inline])
AX_GCC_FUNC_ATTRIBUTE([format])
+ AX_GCC_FUNC_ATTRIBUTE([nonnull])
+ AX_GCC_FUNC_ATTRIBUTE([noreturn])
+ AX_GCC_FUNC_ATTRIBUTE([unused])
AS_IF([test "$ax_cv_have_func_attribute_format" = "yes"], [
AC_DEFINE([HAVE___ATTRIBUTE__], [1],
#elif defined(AFS_SGI_ENV) || defined(AFS_USR_SGI_ENV)
#define static_inline static
#define hdr_static_inline(x) x
-#elif defined(AFS_NBSD_ENV) && !defined(AFS_NBSD50_ENV)
+#elif defined(AFS_NBSD_ENV) && !defined(AFS_NBSD50_ENV) \
+ && defined(HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE)
#define static_inline static __inline __attribute__((always_inline))
#define hdr_static_inline(x) static __inline __attribute__((always_inline)) x
#else
#define afs_int_to_pointer(i) ((void *) (i))
#endif
-#if defined(__GNUC__) && __GNUC__ > 2
-#define AFS_UNUSED __attribute__((unused))
-#define AFS_ATTRIBUTE_FORMAT(style,x,y) __attribute__((format(style, x, y)))
-#define AFS_NORETURN __attribute__((__noreturn__))
-#define AFS_NONNULL(x) __attribute__((__nonnull__ x))
-#elif defined (__clang__)
-#define AFS_UNUSED __attribute__((unused))
-#define AFS_ATTRIBUTE_FORMAT(style,x,y) __attribute__((format(style, x, y)))
-#define AFS_NORETURN __attribute__((__noreturn__))
-#define AFS_NONNULL(x) __attribute__((__nonnull__ x))
+#ifdef HAVE_FUNC_ATTRIBUTE_UNUSED
+# define AFS_UNUSED __attribute__((unused))
#else
-#define AFS_UNUSED
-#define AFS_ATTRIBUTE_FORMAT(style,x,y)
-#define AFS_NORETURN
-#define AFS_NONNULL(x)
+# define AFS_UNUSED
+#endif
+
+#ifdef HAVE_FUNC_ATTRIBUTE_FORMAT
+# define AFS_ATTRIBUTE_FORMAT(style,x,y) __attribute__((format(style, x, y)))
+#else
+# define AFS_ATTRIBUTE_FORMAT(style,x,y)
+#endif
+
+#ifdef HAVE_FUNC_ATTRIBUTE_NORETURN
+# define AFS_NORETURN __attribute__((__noreturn__))
+#else
+# define AFS_NORETURN
+#endif
+
+#ifdef HAVE_FUNC_ATTRIBUTE_NONNULL
+# define AFS_NONNULL(x) __attribute__((__nonnull__ x))
+#else
+# define AFS_NONNULL(x)
#endif
/*