Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
AX_GCC_FUNC_ATTRIBUTE([malloc])
AX_GCC_FUNC_ATTRIBUTE([packed])
AX_GCC_FUNC_ATTRIBUTE([pure])
+AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
AX_GCC_FUNC_ATTRIBUTE([unused])
AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
# optimize
# packed
# pure
+# returns_nonnull
# unused
# used
# visibility
#serial 2
+# mattst88:
+# Added support for returns_nonnull attribute
+
AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
[pure], [
int foo( void ) __attribute__(($1));
],
+ [returns_nonnull], [
+ int *foo( void ) __attribute__(($1));
+ ],
[unused], [
int foo( void ) __attribute__(($1));
],
#define ATTRIBUTE_PURE
#endif
+#ifdef HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL
+#define ATTRIBUTE_RETURNS_NONNULL __attribute__((__returns_nonnull__))
+#else
+#define ATTRIBUTE_RETURNS_NONNULL
+#endif
+
#ifdef __cplusplus
/**
* Macro function that evaluates to true if T is a trivially