summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-22 10:28:36 +0000
committerhenry <henry@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-11-22 10:28:36 +0000
commit8cacb9c7351087b8072e424c4db0eabfd2cbf1c6 (patch)
tree13e97ca7d0c27e8f60ae939ed48d26147a3c9fc4 /configure
parent03301bcf6f0017ab570c7ecd0ab6ab0ba687a255 (diff)
downloadmpv-8cacb9c7351087b8072e424c4db0eabfd2cbf1c6.tar.bz2
mpv-8cacb9c7351087b8072e424c4db0eabfd2cbf1c6.tar.xz
check for __builtin_expect (used by libmpeg2)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14015 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure b/configure
index efad5d2507..d5ac8632aa 100755
--- a/configure
+++ b/configure
@@ -2309,6 +2309,25 @@ else
fi
+echocheck "__builtin_expect"
+# GCC branch prediction hint
+cat > $TMPC << EOF
+int foo (int a) {
+ a = __builtin_expect (a, 10);
+ return a == 10 ? 0 : 1;
+}
+int main() { return foo(10) && foo(0); }
+EOF
+_builtin_expect=no
+cc_check && _builtin_expect=yes
+if test "$_builtin_expect" = yes ; then
+ _def_builtin_expect='#define HAVE_BUILTIN_EXPECT 1'
+else
+ _def_builtin_expect='#undef HAVE_BUILTIN_EXPECT'
+fi
+echores "$_builtin_expect"
+
+
echocheck "kstat"
cat > $TMPC << EOF
#include <kstat.h>
@@ -6672,6 +6691,9 @@ $_def_dynamic_plugins
/* "restrict" keyword */
$_def_restrict_keyword
+/* __builtin_expect branch prediction hint */
+$_def_builtin_expect
+
/* attribute(used) as needed by some compilers */
#if (__GNUC__ * 100 + __GNUC_MINOR__ >= 300)
# define attribute_used __attribute__((used))