FS-10690: [libblade] fixed up libconfig to treat 1.4.x as legacy for debian 8 system packages, with 1.5.0 expected on windows and newer linux

This commit is contained in:
Shane Bryldt 2017-10-10 06:32:59 -06:00
parent 03eb15c978
commit a173023827
3 changed files with 6 additions and 6 deletions

View File

@ -126,7 +126,7 @@ ks_status_t blade_mastermgr_config(blade_mastermgr_t *bmmgr, config_setting_t *c
master = config_setting_get_member(config, "master");
if (master) {
master_nodeid = config_lookup_from(master, "nodeid");
master_nodeid = config_setting_lookup(master, "nodeid");
if (!master_nodeid) return KS_STATUS_FAIL;
if (config_setting_type(master_nodeid) != CONFIG_TYPE_STRING) return KS_STATUS_FAIL;

View File

@ -165,7 +165,7 @@ KS_DECLARE(ks_status_t) blade_restmgr_destroy(blade_restmgr_t **brestmgrP)
}
#define CONFIG_LOADSTR(k) \
tmp = config_lookup_from(rest, k); \
tmp = config_setting_lookup(rest, k); \
if (tmp && config_setting_type(tmp) != CONFIG_TYPE_STRING) return KS_STATUS_FAIL; \
if (tmp) ks_hash_insert(brestmgr->config.options, (void *)k, (void *)ks_pstrdup(pool, config_setting_get_string(tmp)));
@ -186,7 +186,7 @@ ks_status_t blade_restmgr_config(blade_restmgr_t *brestmgr, config_setting_t *co
rest = config_setting_get_member(config, "rest");
if (rest) {
tmp = config_lookup_from(rest, "enabled");
tmp = config_setting_lookup(rest, "enabled");
if (!tmp) return KS_STATUS_FAIL;
if (config_setting_type(tmp) != CONFIG_TYPE_BOOL) return KS_STATUS_FAIL;

View File

@ -65,9 +65,9 @@
KS_BEGIN_EXTERN_C
#ifdef _WIN32
// @todo look into why the tarball build has a different function name from the debian package
#define config_lookup_from config_setting_lookup
// legacy for libconfig pre 1.5.0
#if (LIBCONFIG_VER_MAJOR <= 1) && (LIBCONFIG_VER_MINOR <= 4)
#define config_setting_lookup config_lookup_from
#endif
#ifdef __APPLE__