From: Simon Marchi Date: Tue, 13 Nov 2012 19:28:41 +0000 (-0500) Subject: Add max() and min() macro in common X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b33f89bf07e0eaf5742f6c7738d7d20e260dd620;p=lttng-tools.git Add max() and min() macro in common commit cf3f19ae5f634bf07dcdb771e66d40f805700a17 upstream. Signed-off-by: Simon Marchi Signed-off-by: David Goulet Signed-off-by: Christian Babeux --- diff --git a/src/common/macros.h b/src/common/macros.h index 8185c85ab..81f901c2d 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -52,4 +52,12 @@ #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 */