Skip to content

Commit b408c6a

Browse files
committed
Merge #579: Use __GNUC_PREREQ for detecting __builtin_expect
c663397 Use __GNUC_PREREQ for detecting __builtin_expect (Tim Ruffing) Pull request description: Tree-SHA512: 659a721da835eb15966a2a5386d6ae4c3defbb6ad473905f14161a3cf36d1556d44d887602019c89ebeffdfd82ed469ff27914dc2aaee6648d1e0c8a22151c27
2 parents e34ceb3 + c663397 commit b408c6a

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

configure.ac

-6
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,6 @@ AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto]
153153

154154
AC_CHECK_TYPES([__int128])
155155

156-
AC_MSG_CHECKING([for __builtin_expect])
157-
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_expect(0,0);}]])],
158-
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]) ],
159-
[ AC_MSG_RESULT([no])
160-
])
161-
162156
if test x"$enable_coverage" = x"yes"; then
163157
AC_DEFINE(COVERAGE, 1, [Define this symbol to compile out all VERIFY code])
164158
CFLAGS="$CFLAGS -O0 --coverage"

src/util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback *
3636
} while(0)
3737
#endif
3838

39-
#ifdef HAVE_BUILTIN_EXPECT
39+
#if SECP256K1_GNUC_PREREQ(3, 0)
4040
#define EXPECT(x,c) __builtin_expect((x),(c))
4141
#else
4242
#define EXPECT(x,c) (x)

0 commit comments

Comments
 (0)