Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Comment thread
luke-jr marked this conversation as resolved.
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)
Expand Down Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/datum_conf_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/datum_jsonrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 1 addition & 6 deletions src/datum_jsonrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/datum_stratum_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading