From 7f1c264d3049cd95234e91970ccb5406e1d15b27 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 15 May 2014 18:01:52 +1000 Subject: - (djm) [sshbuf.c] need __predict_false --- sshbuf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sshbuf.c') diff --git a/sshbuf.c b/sshbuf.c index 36a8b92f..7f7b9f1d 100644 --- a/sshbuf.c +++ b/sshbuf.c @@ -28,6 +28,16 @@ #include "ssherr.h" #include "sshbuf.h" +/* XXX move to defines.h? */ +#if defined(__GNUC__) && \ + ((__GNUC__ > (2)) || (__GNUC__ == (2) && __GNUC_MINOR__ >= (96))) +#define __predict_true(exp) __builtin_expect(((exp) != 0), 1) +#define __predict_false(exp) __builtin_expect(((exp) != 0), 0) +#else +#define __predict_true(exp) ((exp) != 0) +#define __predict_false(exp) ((exp) != 0) +#endif + static inline int sshbuf_check_sanity(const struct sshbuf *buf) { -- cgit v1.2.1