]> git.sur5r.net Git - i3/i3/blobdiff - include/yajl_utils.h
Merge branch 'release-4.16.1'
[i3/i3] / include / yajl_utils.h
index cf963073fcbdb3dd40dc0277f941e8c00d4878a3..6ab1ff1c478bd44165dccf9d00a459fcc60b484a 100644 (file)
@@ -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 <config.h>
+
 #include <yajl/yajl_gen.h>
 #include <yajl/yajl_parse.h>
 #include <yajl/yajl_version.h>
 
 /* 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