Skip to content

Commit 9000458

Browse files
committed
Merge pull request bitcoin#145
1f46b00 build: fix __builtin_expect detection for clang (Cory Fields)
2 parents aaba2e0 + 1f46b00 commit 9000458

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

configure.ac

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ AC_ARG_WITH([scalar], [AS_HELP_STRING([--with-scalar=64bit|32bit|auto],
103103

104104
AC_CHECK_TYPES([__int128])
105105

106-
AC_CHECK_DECL(__builtin_expect,AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]),,)
106+
AC_MSG_CHECKING([for __builtin_expect])
107+
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[void myfunc() {__builtin_expect(0,0);}]])],
108+
[ AC_MSG_RESULT([yes]);AC_DEFINE(HAVE_BUILTIN_EXPECT,1,[Define this symbol if __builtin_expect is available]) ],
109+
[ AC_MSG_RESULT([no])
110+
])
107111

108112
if test x"$req_field" = x"auto"; then
109113
SECP_64BIT_ASM_CHECK

0 commit comments

Comments
 (0)