From 01ee0f7ef903a692b0fb94b76d57eac6a2c8700b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 6 Feb 2014 15:26:02 +1000 Subject: [PATCH] util: add min/max macros Signed-off-by: Peter Hutterer --- src/libinput-util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libinput-util.h b/src/libinput-util.h index 381a0d44..2fbce72f 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -73,6 +73,9 @@ int list_empty(const struct list *list); #define ARRAY_FOR_EACH(_arr, _elem) \ for (int i = 0; (_elem = &_arr[i]) && i < ARRAY_LENGTH(_arr); i++) +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define max(a, b) (((a) > (b)) ? (a) : (b)) + /* * This fixed point implementation is a verbatim copy from wayland-util.h from * the Wayland project, with the wl_ prefix renamed li_.