]> Git Repo - secp256k1.git/commitdiff
Use __GNUC_PREREQ for detecting __builtin_expect
authorTim Ruffing <[email protected]>
Mon, 17 Dec 2018 10:46:54 +0000 (11:46 +0100)
committerTim Ruffing <[email protected]>
Mon, 17 Dec 2018 10:47:25 +0000 (11:47 +0100)
configure.ac
src/util.h

index 68c45a56f0aa09d88888ff94c9a43e48cb78b86f..0657b71f93cc151e38b1166447c63634c84014f0 100644 (file)
@@ -153,12 +153,6 @@ AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto]
 
 AC_CHECK_TYPES([__int128])
 
-AC_MSG_CHECKING([for __builtin_expect])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_expect(0,0);}]])],
-    [ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]) ],
-    [ AC_MSG_RESULT([no])
-    ])
-
 if test x"$enable_coverage" = x"yes"; then
     AC_DEFINE(COVERAGE, 1, [Define this symbol to compile out all VERIFY code])
     CFLAGS="$CFLAGS -O0 --coverage"
index e0147500f9944194555f86dee300ccea7018c631..e1f5b764527d9a70febb0f2a6f94c5dfc6f3d7a2 100644 (file)
@@ -36,7 +36,7 @@ static SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback *
 } while(0)
 #endif
 
-#ifdef HAVE_BUILTIN_EXPECT
+#if SECP256K1_GNUC_PREREQ(3, 0)
 #define EXPECT(x,c) __builtin_expect((x),(c))
 #else
 #define EXPECT(x,c) (x)
This page took 0.026981 seconds and 4 git commands to generate.