- (djm) [sshbuf.c] need __predict_false

This commit is contained in:
Damien Miller 2014-05-15 18:01:52 +10:00
parent e7429f2be8
commit 7f1c264d30
2 changed files with 11 additions and 0 deletions

View File

@ -139,6 +139,7 @@
[regress/unittests/test_helper/fuzz.c]
[regress/unittests/test_helper/test_helper.c]
Hook new unit tests into the build and "make tests"
- (djm) [sshbuf.c] need __predict_false
20140430
- (dtucker) [defines.h] Define __GNUC_PREREQ__ macro if we don't already

View File

@ -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)
{