common: move MIN and MAX to common/macros.h

This commit is contained in:
John Lindgren 2023-10-20 20:24:29 -04:00 committed by Johan Malm
parent 5cb1d0e83f
commit 048d22d473
5 changed files with 21 additions and 8 deletions

View file

@ -32,4 +32,22 @@
(dest)->name.notify = handle_##name; \
wl_signal_add(&(src)->events.name, &(dest)->name)
/**
* MIN() - Minimum of two values.
*
* @note Arguments may be evaluated twice.
*/
#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif
/**
* MAX() - Maximum of two values.
*
* @note Arguments may be evaluated twice.
*/
#ifndef MAX
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#endif
#endif /* LABWC_MACROS_H */