X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fyajl_utils.h;h=6ab1ff1c478bd44165dccf9d00a459fcc60b484a;hb=b8b5a61a2d4f09520218a4979543cba5f9ead3f7;hp=cf963073fcbdb3dd40dc0277f941e8c00d4878a3;hpb=2314f107784196d8fc7ee500645dbdf548f91386;p=i3%2Fi3 diff --git a/include/yajl_utils.h b/include/yajl_utils.h index cf963073..6ab1ff1c 100644 --- a/include/yajl_utils.h +++ b/include/yajl_utils.h @@ -2,27 +2,23 @@ * vim:ts=4:sw=4:expandtab * * i3 - an improved dynamic tiling window manager - * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE) + * © 2009 Michael Stapelberg and contributors (see also: LICENSE) * * yajl_utils.h * */ #pragma once +#include + #include #include #include /* Shorter names for all those yajl_gen_* functions */ -#define y(x, ...) yajl_gen_ ## x (gen, ##__VA_ARGS__) -#define ystr(str) yajl_gen_string(gen, (unsigned char*)str, strlen(str)) +#define y(x, ...) yajl_gen_##x(gen, ##__VA_ARGS__) +#define ystr(str) yajl_gen_string(gen, (unsigned char *)str, strlen(str)) -#if YAJL_MAJOR >= 2 #define ygenalloc() yajl_gen_alloc(NULL) #define yalloc(callbacks, client) yajl_alloc(callbacks, NULL, client) typedef size_t ylength; -#else -#define ygenalloc() yajl_gen_alloc(NULL, NULL); -#define yalloc(callbacks, client) yajl_alloc(callbacks, NULL, NULL, client) -typedef unsigned int ylength; -#endif