diff --git a/include/labwc.h b/include/labwc.h index 38edf348..68a69817 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -61,6 +61,14 @@ #define XCURSOR_DEFAULT "left_ptr" #define XCURSOR_SIZE 24 +#ifndef MIN +#define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif + +#ifndef MAX +#define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif + enum input_mode { LAB_INPUT_STATE_PASSTHROUGH = 0, LAB_INPUT_STATE_MOVE, diff --git a/src/ssd/ssd_part.c b/src/ssd/ssd_part.c index 5b5e6820..07cd6959 100644 --- a/src/ssd/ssd_part.c +++ b/src/ssd/ssd_part.c @@ -123,10 +123,8 @@ get_scale_box(struct wlr_buffer *buffer, double container_width, /* Scale down buffer if required */ if (icon_geo.width && icon_geo.height) { - #define MIN(a, b) ((a) < (b) ? (a) : (b)) double scale = MIN(container_width / icon_geo.width, container_height / icon_geo.height); - #undef MIN if (scale < 1.0f) { icon_geo.width = (double)icon_geo.width * scale; icon_geo.height = (double)icon_geo.height * scale; diff --git a/src/view.c b/src/view.c index 34446a45..468c019d 100644 --- a/src/view.c +++ b/src/view.c @@ -14,8 +14,6 @@ #define LAB_FALLBACK_WIDTH 640 #define LAB_FALLBACK_HEIGHT 480 -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - /** * All view_apply_xxx_geometry() functions must *not* modify * any state besides repositioning or resizing the view. diff --git a/src/xwayland.c b/src/xwayland.c index 353f49ff..7c935dad 100644 --- a/src/xwayland.c +++ b/src/xwayland.c @@ -7,8 +7,6 @@ #include "view.h" #include "workspaces.h" -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) - static int round_to_increment(int val, int base, int inc) {