diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-15 11:46:21 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-10-15 11:46:21 +0100 |
commit | b8bc9298b16c3b73aead0b15fa60cf061168a8a2 (patch) | |
tree | 0b5eda0a338b22ddd7e257f709242d03264a6fdf /contrib | |
parent | 33a845c0edb73b759e7e20c11ea36b2d15353b12 (diff) | |
download | rspamd-b8bc9298b16c3b73aead0b15fa60cf061168a8a2.tar.gz rspamd-b8bc9298b16c3b73aead0b15fa60cf061168a8a2.zip |
More fixes to libottery.
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/libottery/ottery-internal.h | 10 | ||||
-rw-r--r-- | contrib/libottery/ottery.c | 6 | ||||
-rw-r--r-- | contrib/libottery/ottery_global.c | 9 |
3 files changed, 10 insertions, 15 deletions
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; |