Add max() and min() macro in common
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 13 Nov 2012 19:28:41 +0000 (14:28 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Fri, 7 Dec 2012 20:17:54 +0000 (15:17 -0500)
commit cf3f19ae5f634bf07dcdb771e66d40f805700a17 upstream.

Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
src/common/macros.h

index 8185c85abfdacdece8bd4442cc10ca2898b8bd32..81f901c2d5d171bda6a6f064124d8c49bbf76944 100644 (file)
 #define ARRAY_SIZE(array)   (sizeof(array) / (sizeof((array)[0])))
 #endif
 
+#ifndef max
+#define max(a, b) ((a) > (b) ? (a) : (b))
+#endif
+
+#ifndef min
+#define min(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
 #endif /* _MACROS_H */
This page took 0.02605 seconds and 4 git commands to generate.