summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-20 21:14:36 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-05-20 21:14:36 +0200
commit35bde472b5455bab19157922dab06a5c2864bced (patch)
tree6ad480f8075bd74ab1fc26247e30e0b0161fb58f /m4
parent77a00bc73b2ab8eb0924e09fe18f5b0e694949e1 (diff)
downloadxine-lib-35bde472b5455bab19157922dab06a5c2864bced.tar.gz
xine-lib-35bde472b5455bab19157922dab06a5c2864bced.tar.bz2
Add check for const attribute (for mathematical functions).
Add CC_ATTRIBUTE_CONST macro to the attributes.h. Run CC_ATTRIBUTE_CONST in configure. Define SUPPORT_ATTRIBUTE_CONST for GCC 3. Define XINE_CONST to __attribute__((__const__)) if supported. --HG-- extra : transplant_source : /26%26%DF%C0%3C%AC%27%5C%B7%B1y%FEQ%8Ay%EE%F1%BD
Diffstat (limited to 'm4')
-rw-r--r--m4/attributes.m48
1 files changed, 8 insertions, 0 deletions
diff --git a/m4/attributes.m4 b/m4/attributes.m4
index fa379a2fe..f71b3d0d0 100644
--- a/m4/attributes.m4
+++ b/m4/attributes.m4
@@ -188,6 +188,14 @@ AC_DEFUN([CC_ATTRIBUTE_PACKED], [
[$2])
])
+AC_DEFUN([CC_ATTRIBUTE_CONST], [
+ CC_CHECK_ATTRIBUTE(
+ [const], ,
+ [int __attribute__((const)) twopow(int n) { return 1 << n; } ],
+ [$1],
+ [$2])
+])
+
AC_DEFUN([CC_FLAG_VISIBILITY], [
AC_REQUIRE([CC_CHECK_WERROR])
AC_CACHE_CHECK([if $CC supports -fvisibility=hidden],