JSON: avoid recent library version usage
authorJeremy Harris <jgh146exb@wizmail.org>
Wed, 9 Jan 2019 16:49:52 +0000 (16:49 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Thu, 10 Jan 2019 15:23:49 +0000 (15:23 +0000)
Also create feature-macro

src/src/lookups/json.c
src/src/macro_predef.c

index 013013ae808aac535fdaa81b0432093456e12f80..5fe1f1c5d5a90770f6d25eb6a4ffd7f5a631e6d9 100644 (file)
@@ -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;
index 84a33282dd0521b1b2d819cc025229cc71b6e3c5..f92671ae2b85db5d96d00dfb37d517fe970bd1b4 100644 (file)
@@ -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