# HG changeset patch # User henry # Date 1101119316 0 # Node ID 913abac7e3d1a5f73fa3132405270c5100a194ab # Parent 540512f82d0d05ee814905ebacc7d0dd1ea0d9e6 check for __builtin_expect (used by libmpeg2) diff -r 540512f82d0d -r 913abac7e3d1 configure --- a/configure Mon Nov 22 10:22:31 2004 +0000 +++ b/configure Mon Nov 22 10:28:36 2004 +0000 @@ -2309,6 +2309,25 @@ 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 @@ -6672,6 +6691,9 @@ /* "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))