diff --git a/CMakeLists.txt b/CMakeLists.txt index f081c0b7..0e5d6fa0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,12 +67,12 @@ set(WEB_RESOURCES ) find_package(PkgConfig REQUIRED) -pkg_check_modules(CURL REQUIRED libcurl) -pkg_check_modules(JANSSON REQUIRED jansson) +pkg_check_modules(CURL REQUIRED libcurl>=7.12.1) +pkg_check_modules(JANSSON REQUIRED jansson>=2.7) if(ENABLE_API) -pkg_check_modules(MICROHTTPD REQUIRED libmicrohttpd) +pkg_check_modules(MICROHTTPD REQUIRED libmicrohttpd>=0.9.71) endif() -pkg_check_modules(SODIUM REQUIRED libsodium) +pkg_check_modules(SODIUM REQUIRED libsodium>=1.0.7) find_package(Threads REQUIRED) include(CheckFunctionExists) @@ -132,6 +132,7 @@ if(HAVE_EPOLL_WAIT) set(EPOLL_SHIM_INCLUDE_DIRS "") set(EPOLL_SHIM_LIBRARIES "") else() + # epoll-shim does not publish a version in its pkg-config metadata; its first tagged release provides all APIs used here. pkg_check_modules(EPOLL_SHIM REQUIRED epoll-shim) endif() diff --git a/src/datum_conf_tests.c b/src/datum_conf_tests.c index e9547b79..14925ffe 100644 --- a/src/datum_conf_tests.c +++ b/src/datum_conf_tests.c @@ -195,7 +195,7 @@ void datum_conf_test_parse_username_mods__(const unsigned int code_line, json_t void datum_conf_test_parse_username_mods_(const unsigned int code_line, const char * const input, const int expected_ret, const struct datum_test_username_mods *expected_umods) { json_error_t err; - json_t * const j_input = JSON_LOADS(input, &err); + json_t * const j_input = json_loads(input, 0, &err); assert(j_input); datum_conf_test_parse_username_mods__(code_line, j_input, input, expected_ret, expected_umods); } diff --git a/src/datum_jsonrpc.c b/src/datum_jsonrpc.c index 87ce13cc..0e9ac4fa 100644 --- a/src/datum_jsonrpc.c +++ b/src/datum_jsonrpc.c @@ -191,7 +191,7 @@ json_t *json_rpc_call_full(CURL *curl, const char *url, const char *userpass, co goto err_out; } - val = JSON_LOADS(all_data.buf, &err); + val = json_loads(all_data.buf, 0, &err); if (!val) { DLOG_DEBUG("JSON decode failed(%d): %s", err.line, err.text); goto err_out; diff --git a/src/datum_jsonrpc.h b/src/datum_jsonrpc.h index b06fd098..e78dccf4 100644 --- a/src/datum_jsonrpc.h +++ b/src/datum_jsonrpc.h @@ -42,12 +42,7 @@ #include "datum_conf.h" #ifndef JSON_INTEGER_IS_LONG_LONG -# error "Jansson 2.0 with long long support required!" -#endif -#if JANSSON_MAJOR_VERSION >= 2 -#define JSON_LOADS(str, err_ptr) json_loads((str), 0, (err_ptr)) -#else -#define JSON_LOADS(str, err_ptr) json_loads((str), (err_ptr)) + #error "Jansson with long long support required!" #endif // Legacy functions diff --git a/src/datum_stratum_tests.c b/src/datum_stratum_tests.c index ebcf7af0..3a9e9d0b 100644 --- a/src/datum_stratum_tests.c +++ b/src/datum_stratum_tests.c @@ -550,7 +550,7 @@ static void datum_stratum_minimum_difficulty_configure_tests(void) { void datum_stratum_mod_username_tests() { const char * const s_umods = "{\"x\":{\"addrA\": 0.3}, \"abc\":{\"addrB\":0.3,\"addrC\":0.3},\":)\":{\"\":0.5},\"a.c\":{\"addrD\":1.0}}"; json_error_t err; - json_t * const j_umods = JSON_LOADS(s_umods, &err); + json_t * const j_umods = json_loads(s_umods, 0, &err); assert(j_umods); struct datum_username_mod *umods = NULL; int ret = datum_config_parse_username_mods(&umods, j_umods, false);