mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
(un)likely: use __builtin_expect to inform expected path
Remove also unnecessary comparison in getdata nth_field(). Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
6f179db03d
commit
acba2e265e
4 changed files with 25 additions and 3 deletions
14
configure.ac
14
configure.ac
|
|
@ -69,6 +69,20 @@ AC_CHECK_FUNCS([\
|
|||
strrchr \
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if the compiler supports __builtin_expect])
|
||||
AC_TRY_COMPILE(, [
|
||||
return __builtin_expect(1, 1) ? 1 : 0
|
||||
], [
|
||||
have_builtin_expect=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
have_builtin_expect=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
if test x$have_builtin_expect = xyes ; then
|
||||
AC_DEFINE([HAVE_BUILTIN_EXPECT], [1], [Define to 1 if the compiler supports __builtin_expect.])
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
lib/Makefile
|
||||
man/Makefile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue