diff options
author | Brian Norris <computersforpeace@gmail.com> | 2010-11-29 00:01:56 -0800 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-12-02 05:25:23 +0200 |
commit | 3941e9fd08f1d03a52f6584b70077ff0ac866696 (patch) | |
tree | 2b9f65692025c6521fbeaac3eef648e58901aa5a | |
parent | 340ccfc90f78e3fb762ce3da1ed5fbcd2e02a2bf (diff) |
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 <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r-- | include/common.h | 5 |
1 files changed, 4 insertions, 1 deletions
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])) |