From 5a159cceb35fe08e444bd5a1771f8059888b03ff Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 23 May 2017 15:48:26 -0500 Subject: Add minof/maxof macros that autodetect type. Make xzcat use them. --- lib/lib.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/lib.h b/lib/lib.h index 5d2bb4df..effba9b4 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -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); aabb ? aa : bb;}) + // Functions in need of further review/cleanup #include "lib/pending.h" -- cgit v1.2.3