diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-07-29 12:14:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-29 12:14:39 -0400 |
| commit | a6ffcbdca63db2a179693158319a2862082a098e (patch) | |
| tree | 958924a9e4cc8c1592557a2c68f1c0cba0a0599d /lib/compiler.h | |
| parent | 506fc1ad8ff9685c20c852afa9204796085a2b92 (diff) | |
| parent | 4937287fb91fdb871a225b0339780ea8c4ac138d (diff) | |
Merge pull request #4740 from opensourcerouting/omgwtfbbq
lib: OMGWTFBBQ × 2
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 7c7f4ce294..6700ca9e8b 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) |
