Skip to content

Commit

Permalink
Merge litecoin-project#579: Use __GNUC_PREREQ for detecting __builtin…
Browse files Browse the repository at this point in the history
…_expect

c663397 Use __GNUC_PREREQ for detecting __builtin_expect (Tim Ruffing)

Pull request description:

Tree-SHA512: 659a721da835eb15966a2a5386d6ae4c3defbb6ad473905f14161a3cf36d1556d44d887602019c89ebeffdfd82ed469ff27914dc2aaee6648d1e0c8a22151c27
  • Loading branch information
sipa committed Feb 4, 2019
2 parents e34ceb3 + c663397 commit b408c6a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b408c6a

Please sign in to comment.