summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2019-01-09 16:49:52 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2019-01-10 15:23:49 +0000
commit9669c6e06fa8441557a70ba0759eda19287681ad (patch)
tree3e4e8cd7b9c8a08aa87d55e18da516226f12ab69
parent11b31159ac7d1acef923c29053fc3d9c6bbf5c12 (diff)
JSON: avoid recent library version usage
Also create feature-macro
-rw-r--r--src/src/lookups/json.c4
-rw-r--r--src/src/macro_predef.c3
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
@@ -223,6 +223,9 @@ due to conflicts with other common macros. */
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
#ifdef EXPERIMENTAL_LMDB