aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-03-06 20:25:44 +0000
committerNick Mathewson <nickm@torproject.org>2007-03-06 20:25:44 +0000
commit5d1bee87ffe3dcdaa9e7960b0fed836aa1d01b9b (patch)
tree5f9aea61df183fd3a5b88223789babc1fb859a67 /src/common/compat.h
parentc9e2766e7598a669d3acf3ae0e45e8be8b5945b0 (diff)
downloadtor-5d1bee87ffe3dcdaa9e7960b0fed836aa1d01b9b.tar.gz
tor-5d1bee87ffe3dcdaa9e7960b0fed836aa1d01b9b.zip
r12468@Kushana: nickm | 2007-03-06 15:24:00 -0500
More unit tests: gcov is fun. svn:r9748
Diffstat (limited to 'src/common/compat.h')
-rw-r--r--src/common/compat.h4
1 files changed, 4 insertions, 0 deletions
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 */