Add max() and min() macro in common
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 13 Nov 2012 19:28:41 +0000 (14:28 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 13 Nov 2012 19:37:28 +0000 (14:37 -0500)
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: David Goulet <dgoulet@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.031905 seconds and 4 git commands to generate.