summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac40
1 files changed, 40 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 650fc91..ed42e9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,9 +91,49 @@ then
then
_sk_printf='SK_ATTRIBUTE(format (printf, i, j))'
fi
+
+ AX_GCC_FUNC_ATTRIBUTE([malloc])
+ if test x"${ax_cv_have_func_attribute_malloc}" = x'yes'
+ then
+ _sk_malloc='SK_ATTRIBUTE(malloc)'
+ _sk_malloc_free='SK_ATTRIBUTE(malloc, malloc (f, i))'
+ fi
+
+ AX_GCC_FUNC_ATTRIBUTE([nonnull])
+ if test x"${ax_cv_have_func_attribute_nonnull}" = x'yes'
+ then
+ _sk_nonnull='SK_ATTRIBUTE(nonnull (__VA_ARGS__))'
+ _sk_cc_nonnull_check=1
+ fi
+
+ AX_GCC_FUNC_ATTRIBUTE([returns_nonnull])
+ if test x"${ax_cv_have_func_attribute_returns_nonnull}" = x'yes'
+ then
+ _sk_returns_nonnull='SK_ATTRIBUTE(returns_nonnull)'
+ fi
+
+ AX_GCC_FUNC_ATTRIBUTE([sentinel])
+ if test x"${ax_cv_have_func_attribute_sentinel}" = x'yes'
+ then
+ _sk_sentinel='SK_ATTRIBUTE(sentinel(i))'
+ fi
+
+ AX_GCC_FUNC_ATTRIBUTE([warn_unused_result])
+ if test x"${ax_cv_have_func_attribute_warn_unused_result}" = x'yes'
+ then
+ _sk_warn_unused_result='SK_ATTRIBUTE(warn_unused_result)'
+ fi
fi
AC_DEFINE_UNQUOTED([SK_ATTRIBUTE(...)], [${_sk_attribute:-/* attribute(x) */}], [Define to the compiler name of its __attribute__])
AC_DEFINE_UNQUOTED([SK_PRINTF(i, j)], [${_sk_printf:-/* format(printf, i, j) */}], [Define to a code snippet your compiler uses for __attribute__ (format)])
+AC_DEFINE_UNQUOTED([SK_MALLOC], [${_sk_malloc:-/* malloc */}], [...])
+AC_DEFINE_UNQUOTED([SK_MALLOC_FREE(f, i)], [${_sk_malloc_free:-/* malloc (f, i) */}], [...])
+AC_DEFINE_UNQUOTED([SK_NONNULL(...)], [${_sk_nonnull:-/* nonnull(__VA_ARGS__) */}], [...])
+AC_DEFINE_UNQUOTED([SK_RETURNS_NONNULL], [${_sk_returns_nonnull:-/* returns_nonnull */}], [...])
+AC_DEFINE_UNQUOTED([SK_SENTINEL(i)], [${_sk_sentinel:-/* sentinel */}], [...])
+AC_DEFINE_UNQUOTED([SK_WARN_UNUSED_RESULT], [${_sk_warn_unused_result:-/* warn_unused_result */}], [...])
+
+AC_DEFINE_UNQUOTED([HAVE_CC_NONNULL_CHECK], $((_sk_cc_nonnull_check)), [Define to 1 if the CC supports __attribute__(nonnull)])
# Checks for libraries.