From 3941e9fd08f1d03a52f6584b70077ff0ac866696 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 29 Nov 2010 00:01:56 -0800 Subject: common.h: Add MAX() macro, fix MIN() Add MAX() macro to common.h, to be used in future patches. Also a style change in comma location on MIN(). Signed-off-by: Brian Norris Signed-off-by: Artem Bityutskiy --- include/common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/common.h b/include/common.h index 25abc0c..eb8d5fc 100644 --- a/include/common.h +++ b/include/common.h @@ -34,7 +34,10 @@ extern "C" { #endif #ifndef MIN /* some C lib headers define this for us */ -#define MIN(a ,b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef MAX +#define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif #define min(a, b) MIN(a, b) /* glue for linux kernel source */ #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) -- cgit v1.2.3