From: Tobias Brunner Date: Tue, 18 Apr 2023 14:38:18 +0000 (+0200) Subject: plugin-loader: Fix build with DEBUG_LEVEL < 3 X-Git-Tag: 5.9.11rc1~12^2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a551f80e4fa8f5ece518e8ed4a81a1abe1f8d65d;p=thirdparty%2Fstrongswan.git plugin-loader: Fix build with DEBUG_LEVEL < 3 --- diff --git a/src/libstrongswan/plugins/plugin_loader.c b/src/libstrongswan/plugins/plugin_loader.c index 89d3f5de02..30b1aeed08 100644 --- a/src/libstrongswan/plugins/plugin_loader.c +++ b/src/libstrongswan/plugins/plugin_loader.c @@ -755,10 +755,11 @@ static bool load_dependencies(private_plugin_loader_t *this, { bool soft = provided->feature[i].kind == FEATURE_SDEPEND; -#ifndef USE_FUZZING +#if !defined(USE_FUZZING) && DEBUG_LEVEL >= 1 char *name, *provide, *depend; +#if DEBUG_LEVEL >= 3 int indent = level * 2; - +#endif name = provided->entry->plugin->get_name(provided->entry->plugin); provide = plugin_feature_get_string(&provided->feature[0]); depend = plugin_feature_get_string(&provided->feature[i]); @@ -779,7 +780,7 @@ static bool load_dependencies(private_plugin_loader_t *this, } free(provide); free(depend); -#endif /* !USE_FUZZING */ +#endif /* !USE_FUZZING && DEBUG_LEVEL */ if (soft) { /* it's ok if we can't resolve soft dependencies */ @@ -809,7 +810,7 @@ static void load_feature(private_plugin_loader_t *this, return; } -#ifndef USE_FUZZING +#if !defined(USE_FUZZING) && DEBUG_LEVEL >= 1 char *name, *provide; name = provided->entry->plugin->get_name(provided->entry->plugin); @@ -825,7 +826,7 @@ static void load_feature(private_plugin_loader_t *this, provide, name); } free(provide); -#endif /* !USE_FUZZING */ +#endif /* !USE_FUZZING && DEBUG_LEVEL */ } else { /* TODO: we could check the current level and set a different flag when @@ -845,13 +846,12 @@ static void load_provided(private_plugin_loader_t *this, provided_feature_t *provided, int level) { - if (provided->loaded || provided->failed) { return; } -#ifndef USE_FUZZING +#if !defined(USE_FUZZING) && DEBUG_LEVEL >= 3 char *name, *provide; int indent = level * 2; @@ -872,7 +872,7 @@ static void load_provided(private_plugin_loader_t *this, { return; } -#endif /* USE_FUZZING */ +#endif /* USE_FUZZING && DEBUG_LEVEL */ provided->loading = TRUE; load_feature(this, provided, level + 1);