From 90bb53f8c9b7ca3db6841a5005af791b93782d96 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Sat, 3 May 2008 14:34:45 +0100 Subject: Add support for "deprecated" attribute. --- m4/attributes.m4 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'm4') diff --git a/m4/attributes.m4 b/m4/attributes.m4 index 55f34c9f7..a74280696 100644 --- a/m4/attributes.m4 +++ b/m4/attributes.m4 @@ -322,3 +322,26 @@ AC_DEFUN([CC_ATTRIBUTE_ALIGNED], [ [Define the highest alignment supported]) fi ]) + +AC_DEFUN([CC_ATTRIBUTE_DEPRECATED], [ + AC_REQUIRE([CC_CHECK_WERROR]) + ac_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $cc_cv_werror" + AC_CACHE_CHECK([if compiler supports __attribute__((deprecated))], + [cc_cv_attribute_alias], + [AC_COMPILE_IFELSE([ + void some_function(void) __attribute__((deprecated)); + ], + [cc_cv_attribute_deprecated=yes], + [cc_cv_attribute_deprecated=no]) + ]) + CFLAGS="$ac_save_CFLAGS" + + if test "x$cc_cv_attribute_deprecated" = "xyes"; then + AC_DEFINE([SUPPORT_ATTRIBUTE_DEPRECATED], 1, [Define this if the compiler supports the deprecated attribute]) + $1 + else + true + $2 + fi +]) -- cgit v1.2.3