From: Kacper Kowalik (Xarthisius) Date: Tue, 8 Mar 2016 01:40:02 +0000 (-0600) Subject: Add missing MAX macros, ensure that i3 can be compiled without pango X-Git-Tag: 4.13~107^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=301320585e1a34b51e7229345ed7f1013cd870cd;p=i3%2Fi3 Add missing MAX macros, ensure that i3 can be compiled without pango --- diff --git a/libi3/font.c b/libi3/font.c index 5a2504fa..00e7dfb3 100644 --- a/libi3/font.c +++ b/libi3/font.c @@ -397,9 +397,11 @@ static void draw_text_xcb(const xcb_char2b_t *text, size_t text_len, xcb_drawabl void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, xcb_visualtype_t *visual, int x, int y, int max_width) { assert(savedFont != NULL); +#if PANGO_SUPPORT if (visual == NULL) { visual = root_visual_type; } +#endif switch (savedFont->type) { case FONT_TYPE_NONE: diff --git a/src/floating.c b/src/floating.c index 231577fd..65a2810a 100644 --- a/src/floating.c +++ b/src/floating.c @@ -11,6 +11,10 @@ */ #include "all.h" +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + /* * Calculates sum of heights and sum of widths of all currently active outputs * diff --git a/src/util.c b/src/util.c index 35ce8b19..53f78d72 100644 --- a/src/util.c +++ b/src/util.c @@ -341,10 +341,12 @@ char *pango_escape_markup(char *input) { if (!font_is_pango()) return input; +#if PANGO_SUPPORT char *escaped = g_markup_escape_text(input, -1); FREE(input); return escaped; +#endif } /* diff --git a/src/x.c b/src/x.c index f44bc37a..43db952d 100644 --- a/src/x.c +++ b/src/x.c @@ -12,6 +12,10 @@ */ #include "all.h" +#ifndef MAX +#define MAX(x, y) ((x) > (y) ? (x) : (y)) +#endif + xcb_window_t ewmh_window; /* Stores the X11 window ID of the currently focused window */