diff options
Diffstat (limited to 'shared/helpers.h')
-rw-r--r-- | shared/helpers.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/shared/helpers.h b/shared/helpers.h index 7502ff32..83f79b11 100644 --- a/shared/helpers.h +++ b/shared/helpers.h @@ -41,6 +41,17 @@ extern "C" { #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) #endif +/** + * Returns the smaller of two values. + * + * @param x the first item to compare. + * @param y the second item to compare. + * @return the value that evaluates to lesser than the other. + */ +#ifndef MIN +#define MIN(x,y) (((x) < (y)) ? (x) : (y)) +#endif + #ifdef __cplusplus } #endif |