From 5d1bee87ffe3dcdaa9e7960b0fed836aa1d01b9b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 6 Mar 2007 20:25:44 +0000 Subject: r12468@Kushana: nickm | 2007-03-06 15:24:00 -0500 More unit tests: gcov is fun. svn:r9748 --- src/common/compat.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/common/compat.h') diff --git a/src/common/compat.h b/src/common/compat.h index f578c128f8..07f194282f 100644 --- a/src/common/compat.h +++ b/src/common/compat.h @@ -99,12 +99,16 @@ extern INLINE double U64_TO_DBL(uint64_t x) { #define ATTR_MALLOC __attribute__((malloc)) #define ATTR_NONNULL(x) __attribute__((nonnull x)) #define PREDICT(exp, val) __builtin_expect((exp), (val)) +#define PREDICT_LIKELY(exp) PREDICT((exp), 1) +#define PREDICT_UNLIKELY(exp) PREDICT((exp), 0) #else #define ATTR_NORETURN #define ATTR_PURE #define ATTR_MALLOC #define ATTR_NONNULL(x) #define PREDICT(exp, val) (exp) +#define PREDICT_LIKELY(exp) (exp) +#define PREDICT_UNLIKELY(exp) (exp) #endif /* ===== String compatibility */ -- cgit v1.2.3-54-g00ecf