summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-05-03 14:34:45 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-05-03 14:34:45 +0100
commit90bb53f8c9b7ca3db6841a5005af791b93782d96 (patch)
treedfb47862d7bb0ada90ce2bbc32a781f24ed3774a /m4
parent8d953c5c5cac93671c779cbf9176c6115e7294fa (diff)
downloadxine-lib-90bb53f8c9b7ca3db6841a5005af791b93782d96.tar.gz
xine-lib-90bb53f8c9b7ca3db6841a5005af791b93782d96.tar.bz2
Add support for "deprecated" attribute.
Diffstat (limited to 'm4')
-rw-r--r--m4/attributes.m423
1 files changed, 23 insertions, 0 deletions
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
+])