]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove unused LIBRPZ_(UN)LIKELY macros
authorOndřej Surý <ondrej@isc.org>
Thu, 14 Oct 2021 12:26:07 +0000 (14:26 +0200)
committerOndřej Surý <ondrej@sury.org>
Thu, 14 Oct 2021 13:22:57 +0000 (15:22 +0200)
The librpz.h defined LIRPZ_LIKELY() and LIBRPZ_UNLIKELY() macros that
were actually unused in the code.  Remove the macros and the autoconf
check for __builtin_expect().

configure.ac
lib/dns/include/dns/librpz.h

index a582ad33a492c678d048e8108cb5fe74a18e2026..d45e0300b4ae66688a418edcf1965f0c792c7a5e 100644 (file)
@@ -1155,24 +1155,6 @@ AC_LINK_IFELSE(
   [AC_MSG_RESULT([no])
   ])
 
-#
-# Check for __builtin_expect
-#
-AC_MSG_CHECKING([compiler support for __builtin_expect])
-AC_LINK_IFELSE(
-  [AC_LANG_PROGRAM(
-     [[]],
-     [[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 "yes" = "$have_builtin_expect"; then
-       AC_DEFINE(HAVE_BUILTIN_EXPECT, 1, [Define to 1 if the compiler supports __builtin_expect.])
-fi
-
 #
 # Check for __builtin_clz
 #
index c6afa34379619968ec8fc2ccdbfab268a296b9a3..1d9ce12c52eacea55184a9a00cff45720f0fa453 100644 (file)
@@ -222,14 +222,6 @@ typedef struct {
 #define LIBRPZ_NORET
 #endif /* ifdef LIBRPZ_HAVE_ATTR */
 
-#ifdef HAVE_BUILTIN_EXPECT
-#define LIBRPZ_LIKELY(c)   __builtin_expect(!!(c), 1)
-#define LIBRPZ_UNLIKELY(c) __builtin_expect(!!(c), 0)
-#else /* ifdef HAVE_BUILTIN_EXPECT */
-#define LIBRPZ_LIKELY(c)   (c)
-#define LIBRPZ_UNLIKELY(c) (c)
-#endif /* ifdef HAVE_BUILTIN_EXPECT */
-
 typedef bool(librpz_parse_log_opt_t)(librpz_emsg_t *emsg, const char *arg);
 LIBDEF_F(parse_log_opt)