]> git.ipfire.org Git - thirdparty/systemd.git/commit
macros: add CMP(a, b) macro.
authorFilipe Brandenburger <filbranden@google.com>
Thu, 2 Aug 2018 21:37:42 +0000 (14:37 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Tue, 7 Aug 2018 02:19:05 +0000 (19:19 -0700)
commit84fb2131d0005cc74c37c8751f63971c93d0378a
treef4aa936a6b34135a2ec47940167351cf8502207f
parent117efe065a174c2059e49cd7705245adcf44092d
macros: add CMP(a, b) macro.

Macro returns -1, 0, 1 depending on whether a < b, a == b or a > b.

It's safe to use on unsigned types.

Add tests to confirm corner cases are properly covered.
src/basic/macro.h
src/test/test-util.c