Remove yajl major version conditionals

Yajl version ≥ 2 is required.

fixes #1156
This commit is contained in:
Tony Crisci
2014-05-03 21:02:54 -04:00
committed by Michael Stapelberg
parent 22b4215d92
commit 13db562551
17 changed files with 4 additions and 221 deletions

View File

@ -30,11 +30,7 @@ static int json_boolean(void *ctx, int boolval) {
return 1;
}
#if YAJL_MAJOR >= 2
static int json_map_key(void *ctx, const unsigned char *stringval, size_t stringlen) {
#else
static int json_map_key(void *ctx, const unsigned char *stringval, unsigned int stringlen) {
#endif
parse_error_key = (stringlen >= strlen("parse_error") &&
strncmp((const char*)stringval, "parse_error", strlen("parse_error")) == 0);
return 1;
@ -86,15 +82,8 @@ void handle_key_press(xcb_key_press_event_t *event) {
/* We parse the JSON reply to figure out whether there was an error
* ("success" being false in on of the returned dictionaries). */
const unsigned char *reply;
#if YAJL_MAJOR >= 2
size_t length;
yajl_handle handle = yajl_alloc(&command_error_callbacks, NULL, NULL);
#else
unsigned int length;
yajl_parser_config parse_conf = { 0, 0 };
yajl_handle handle = yajl_alloc(&command_error_callbacks, &parse_conf, NULL, NULL);
#endif
yajl_gen_get_buf(command_output->json_gen, &reply, &length);
current_nesting_level = 0;