diff options
author | Jon Cruz <jonc@osg.samsung.com> | 2015-06-15 15:37:09 -0700 |
---|---|---|
committer | Bryce Harrington <bryce@osg.samsung.com> | 2015-06-15 17:11:52 -0700 |
commit | d618f688d53e1df0ac31a275ae8541dc56f283ed (patch) | |
tree | 2491eabcb4e57b4a3e9604b2b09458f36e2255f8 /shared | |
parent | 35b2eaa989e4960501943c0753e2d5a3e687db92 (diff) | |
download | weston-d618f688d53e1df0ac31a275ae8541dc56f283ed.tar.gz |
Moved the MIN() macro to the helper include.
Removed multiple definitions of the MIN() macro from existing
locations and unified with a single definition. Updated sources
to use the shared version.
Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'shared')
-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 |