X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=i3status.c;h=de63bc17f48029dde8d38ab220e6614c48fb2915;hb=727d9f9f01a8db5f0564f39ece4401c65f533c03;hp=b2b1714508cddacd792ed82a8947d0a6aec4638e;hpb=12b1bfa9b8485de88b0bda82821c021aee197673;p=i3%2Fi3status diff --git a/i3status.c b/i3status.c index b2b1714..de63bc1 100644 --- a/i3status.c +++ b/i3status.c @@ -29,6 +29,7 @@ #include #include +#include #include "i3status.h" @@ -346,7 +347,11 @@ int main(int argc, char *argv[]) { || !valid_color(cfg_getstr(cfg_general, "color_separator"))) die("Bad color format"); +#if YAJL_MAJOR >= 2 yajl_gen json_gen = yajl_gen_alloc(NULL); +#else + yajl_gen json_gen = yajl_gen_alloc(NULL, NULL); +#endif if (output_format == O_I3BAR) { /* Initialize the i3bar protocol. See i3/docs/i3bar-protocol @@ -466,7 +471,11 @@ int main(int argc, char *argv[]) { if (output_format == O_I3BAR) { yajl_gen_array_close(json_gen); const unsigned char *buf; +#if YAJL_MAJOR >= 2 size_t len; +#else + unsigned int len; +#endif yajl_gen_get_buf(json_gen, &buf, &len); write(STDOUT_FILENO, buf, len); yajl_gen_clear(json_gen);