diff options
author | David Lamparter <equinox@diac24.net> | 2019-07-28 09:24:00 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2019-07-28 09:25:58 +0200 |
commit | 1315d74de97be2944d7b005b2f9a50e9ae5eff4d (patch) | |
tree | a229abff3b9f212c83875619f3402dd5004cdd15 /lib/compiler.h | |
parent | Merge pull request #4730 from idryzhov/fix (diff) | |
download | frr-1315d74de97be2944d7b005b2f9a50e9ae5eff4d.tar.xz frr-1315d74de97be2944d7b005b2f9a50e9ae5eff4d.zip |
lib: fix prefix_cmp() return values
OMGWTFBBQ
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/compiler.h')
-rw-r--r-- | lib/compiler.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/compiler.h b/lib/compiler.h index 7c7f4ce29..6700ca9e8 100644 --- a/lib/compiler.h +++ b/lib/compiler.h @@ -165,6 +165,13 @@ extern "C" { _min_a < _min_b ? _min_a : _min_b; \ }) +#define numcmp(a, b) \ + ({ \ + typeof(a) _cmp_a = (a); \ + typeof(b) _cmp_b = (b); \ + (_cmp_a < _cmp_b) ? -1 : ((_cmp_a > _cmp_b) ? 1 : 0); \ + }) + #ifndef offsetof #ifdef __compiler_offsetof #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE,MEMBER) |