diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | defines.h | 13 | ||||
-rw-r--r-- | sshbuf.c | 10 |
3 files changed, 16 insertions, 11 deletions
@@ -1,3 +1,7 @@ | |||
1 | 20140903 | ||
2 | - (djm) [defines.h sshbuf.c] Move __predict_true|false to defines.h and | ||
3 | conditionalise to avoid duplicate definition. | ||
4 | |||
1 | 20140830 | 5 | 20140830 |
2 | - (djm) [openbsd-compat/openssl-compat.h] add | 6 | - (djm) [openbsd-compat/openssl-compat.h] add |
3 | OPENSSL_[RD]SA_MAX_MODULUS_BITS defines for OpenSSL that lacks them | 7 | OPENSSL_[RD]SA_MAX_MODULUS_BITS defines for OpenSSL that lacks them |
@@ -25,7 +25,7 @@ | |||
25 | #ifndef _DEFINES_H | 25 | #ifndef _DEFINES_H |
26 | #define _DEFINES_H | 26 | #define _DEFINES_H |
27 | 27 | ||
28 | /* $Id: defines.h,v 1.182 2014/06/16 12:50:56 dtucker Exp $ */ | 28 | /* $Id: defines.h,v 1.183 2014/09/02 19:33:26 djm Exp $ */ |
29 | 29 | ||
30 | 30 | ||
31 | /* Constants */ | 31 | /* Constants */ |
@@ -830,4 +830,15 @@ struct winsize { | |||
830 | # endif | 830 | # endif |
831 | #endif | 831 | #endif |
832 | 832 | ||
833 | #ifndef __predict_true | ||
834 | # if defined(__GNUC__) && \ | ||
835 | ((__GNUC__ > (2)) || (__GNUC__ == (2) && __GNUC_MINOR__ >= (96))) | ||
836 | # define __predict_true(exp) __builtin_expect(((exp) != 0), 1) | ||
837 | # define __predict_false(exp) __builtin_expect(((exp) != 0), 0) | ||
838 | # else | ||
839 | # define __predict_true(exp) ((exp) != 0) | ||
840 | # define __predict_false(exp) ((exp) != 0) | ||
841 | # endif /* gcc version */ | ||
842 | #endif /* __predict_true */ | ||
843 | |||
833 | #endif /* _DEFINES_H */ | 844 | #endif /* _DEFINES_H */ |
@@ -28,16 +28,6 @@ | |||
28 | #include "ssherr.h" | 28 | #include "ssherr.h" |
29 | #include "sshbuf.h" | 29 | #include "sshbuf.h" |
30 | 30 | ||
31 | /* XXX move to defines.h? */ | ||
32 | #if defined(__GNUC__) && \ | ||
33 | ((__GNUC__ > (2)) || (__GNUC__ == (2) && __GNUC_MINOR__ >= (96))) | ||
34 | #define __predict_true(exp) __builtin_expect(((exp) != 0), 1) | ||
35 | #define __predict_false(exp) __builtin_expect(((exp) != 0), 0) | ||
36 | #else | ||
37 | #define __predict_true(exp) ((exp) != 0) | ||
38 | #define __predict_false(exp) ((exp) != 0) | ||
39 | #endif | ||
40 | |||
41 | static inline int | 31 | static inline int |
42 | sshbuf_check_sanity(const struct sshbuf *buf) | 32 | sshbuf_check_sanity(const struct sshbuf *buf) |
43 | { | 33 | { |