summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2010-11-29 00:01:56 -0800
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-12-02 05:25:23 +0200
commit3941e9fd08f1d03a52f6584b70077ff0ac866696 (patch)
tree2b9f65692025c6521fbeaac3eef648e58901aa5a /include
parent340ccfc90f78e3fb762ce3da1ed5fbcd2e02a2bf (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>
Diffstat (limited to 'include')
-rw-r--r--include/common.h5
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]))