Skip to content

Commit

Permalink
misc/compare.h: add B_COMPARE2() macro
Browse files Browse the repository at this point in the history
  • Loading branch information
ambrop7 committed Mar 15, 2013
1 parent 62ad4c0 commit a2044b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions misc/compare.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@
#define BADVPN_COMPARE_H

#define B_COMPARE(a, b) (((a) > (b)) - ((a) < (b)))
#define B_COMPARE_COMBINE(cmp1, cmp2) ((cmp1) ? (cmp1) : (cmp2))
#define B_COMPARE2(a, b, c, d) B_COMPARE_COMBINE(B_COMPARE((a), (b)), B_COMPARE((c), (d)))

#endif

0 comments on commit a2044b6

Please sign in to comment.