From: Vsevolod Stakhov Date: Thu, 15 Oct 2015 10:46:21 +0000 (+0100) Subject: More fixes to libottery. X-Git-Tag: 1.0.6~26 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b8bc9298b16c3b73aead0b15fa60cf061168a8a2;p=rspamd.git More fixes to libottery. --- diff --git a/contrib/libottery/ottery-internal.h b/contrib/libottery/ottery-internal.h index 7e3f46e05..24279043e 100644 --- a/contrib/libottery/ottery-internal.h +++ b/contrib/libottery/ottery-internal.h @@ -185,6 +185,16 @@ struct ottery_prf { void (*generate)(void *state, uint8_t *output, uint32_t idx); }; +/** + * Evaluate the condition 'x', while hinting to the compiler that it is + * likely to be false. + */ +#ifdef __GNUC__ +#define UNLIKELY(x) __builtin_expect((x), 0) +#else +#define UNLIKELY(x) (x) +#endif + #ifdef OTTERY_INTERNAL struct ottery_config { /** The PRF that we should use. If NULL, we use the default. */ diff --git a/contrib/libottery/ottery.c b/contrib/libottery/ottery.c index 851932e94..fd20b1132 100644 --- a/contrib/libottery/ottery.c +++ b/contrib/libottery/ottery.c @@ -33,12 +33,6 @@ #define OTTERY_NO_PID_CHECK #endif -/** - * Evaluate the condition 'x', while hinting to the compiler that it is - * likely to be false. - */ -#define UNLIKELY(x) __builtin_expect((x), 0) - /** Magic number for deciding whether an ottery_state is initialized. */ #define MAGIC_BASIS 0x11b07734 diff --git a/contrib/libottery/ottery_global.c b/contrib/libottery/ottery_global.c index a1d919885..3c814f5ec 100644 --- a/contrib/libottery/ottery_global.c +++ b/contrib/libottery/ottery_global.c @@ -17,15 +17,6 @@ #include "ottery.h" #include "ottery_st.h" -/** - * Evaluate the condition 'x', while hinting to the compiler that it is - * likely to be false. - */ -#ifdef __GNUC__ -#define UNLIKELY(x) __builtin_expect((x), 0) -#else -#define UNLIKELY(x) (x) -#endif /** Flag: true iff ottery_global_state_ is initialized. */ static int ottery_global_state_initialized_ = 0;