From 9669c6e06fa8441557a70ba0759eda19287681ad Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Wed, 9 Jan 2019 16:49:52 +0000 Subject: [PATCH] JSON: avoid recent library version usage Also create feature-macro --- src/src/lookups/json.c | 4 ++-- src/src/macro_predef.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/src/lookups/json.c b/src/src/lookups/json.c index 013013ae8..5fe1f1c5d 100644 --- a/src/src/lookups/json.c +++ b/src/src/lookups/json.c @@ -69,8 +69,8 @@ do_cache = do_cache; /* Keep picky compilers happy */ rewind(f); if (!(j = json_loadf(f, 0, &jerr))) { - enum json_error_code je = json_error_code(&jerr); - *errmsg = string_sprintf("json err %d on open", je); + *errmsg = string_sprintf("json error on open: %.*s\n", + JSON_ERROR_TEXT_LENGTH, jerr.text); return FAIL; } j0 = j; diff --git a/src/src/macro_predef.c b/src/src/macro_predef.c index 84a33282d..f92671ae2 100644 --- a/src/src/macro_predef.c +++ b/src/src/macro_predef.c @@ -222,6 +222,9 @@ due to conflicts with other common macros. */ #ifdef LOOKUP_IBASE builtin_macro_create(US"_HAVE_LOOKUP_IBASE"); #endif +#ifdef LOOKUP_LDAP + builtin_macro_create(US"_HAVE_LOOKUP_JSON"); +#endif #ifdef LOOKUP_LDAP builtin_macro_create(US"_HAVE_LOOKUP_LDAP"); #endif -- 2.25.1