summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorLevi Morrison <levim@php.net>2015-03-20 11:58:58 -0600
committerLevi Morrison <levim@php.net>2015-03-22 10:31:14 -0600
commit017f89e871a8411765b82cecd09c355377f3a8df (patch)
treeb61dad6185fec86449c187479296d03d1b2d0474 /acinclude.m4
parenta50e9d87f265f911f9c76ca0e998588be0bd6eac (diff)
downloadphp-git-017f89e871a8411765b82cecd09c355377f3a8df.tar.gz
Move check for __builtin_expect to configure
This allows __builtin_expect to be used more accurately
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index b2220c3d5e..478ea31761 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -3031,3 +3031,21 @@ AC_DEFUN([PHP_CHECK_STDINT_TYPES], [
])
AC_DEFINE([PHP_HAVE_STDINT_TYPES], [1], [Checked for stdint types])
])
+
+dnl PHP_CHECK_BUILTIN_EXPECT
+AC_DEFUN([PHP_CHECK_BUILTIN_EXPECT], [
+ AC_MSG_CHECKING([for __builtin_expect])
+
+ AC_TRY_LINK(, [
+ return __builtin_expect(1,1) ? 1 : 0;
+ ], [
+ have_builtin_expect=1
+ AC_MSG_RESULT([yes])
+ ], [
+ have_builtin_expect=0
+ AC_MSG_RESULT([no])
+ ])
+
+ AC_DEFINE([PHP_HAVE_BUILTIN_EXPECT], [$have_builtin_expect], [Whether the compiler supports __builtin_expect])
+
+])