From bf8e74c23c8c8a28a007679f68621cee5d146e1e Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 15 Sep 2021 14:22:56 +0200 Subject: [PATCH] config: fix undefined functions --- lib/config.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/config.cpp b/lib/config.cpp index b45840449..0a90b134a 100644 --- a/lib/config.cpp +++ b/lib/config.cpp @@ -161,13 +161,6 @@ std::list Config::getIncludeDirectories(FILE *f) const return dirs; } -const char ** Config::includeFuncStub(config_t *cfg, const char *include_dir, const char *path, const char **error) -{ - void *ctx = config_get_hook(cfg); - - return reinterpret_cast(ctx)->includeFunc(cfg, include_dir, path, error); -} - std::list Config::resolveIncludes(const std::string &n) { glob_t gb; @@ -219,6 +212,15 @@ void Config::resolveEnvVars(std::string &text) } } +#ifdef WITH_CONFIG +#if (LIBCONFIG_VER_MAJOR > 1) || ((LIBCONFIG_VER_MAJOR == 1) && (LIBCONFIG_VER_MINOR >= 7)) +const char ** Config::includeFuncStub(config_t *cfg, const char *include_dir, const char *path, const char **error) +{ + void *ctx = config_get_hook(cfg); + + return reinterpret_cast(ctx)->includeFunc(cfg, include_dir, path, error); +} + const char ** Config::includeFunc(config_t *cfg, const char *include_dir, const char *path, const char **error) { auto paths = resolveIncludes(path); @@ -233,8 +235,8 @@ const char ** Config::includeFunc(config_t *cfg, const char *include_dir, const return files; } +#endif -#ifdef WITH_CONFIG json_t * Config::libconfigDecode(FILE *f) { int ret;