diff options
author | Rob Landley <rob@landley.net> | 2017-05-23 15:48:26 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-05-23 15:48:26 -0500 |
commit | 5a159cceb35fe08e444bd5a1771f8059888b03ff (patch) | |
tree | de7fc8d4809d0515e972eb507ca53db27f6b74ee /lib | |
parent | 77f9c7700604127f9e9f46d44764ca3db978f706 (diff) | |
download | toybox-5a159cceb35fe08e444bd5a1771f8059888b03ff.tar.gz |
Add minof/maxof macros that autodetect type. Make xzcat use them.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lib.h | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -341,5 +341,8 @@ pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid); // Wrapper that discards true/false "did it exit" value. #define NOEXIT(x) WOULD_EXIT(_noexit_res, x) +#define minof(a, b) ({typeof(a) aa = (a); typeof(b) bb = (b); aa<bb ? aa : bb;}) +#define maxof(a, b) ({typeof(a) aa = (a); typeof(b) bb = (b); aa>bb ? aa : bb;}) + // Functions in need of further review/cleanup #include "lib/pending.h" |