From: Simon Marchi Date: Tue, 13 Nov 2012 19:28:41 +0000 (-0500) Subject: Add max() and min() macro in common X-Git-Tag: v2.1.0-rc8~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cf3f19ae5f634bf07dcdb771e66d40f805700a17;p=lttng-tools.git Add max() and min() macro in common Signed-off-by: Simon Marchi Signed-off-by: David Goulet --- 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 */