]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
plugin-loader: Fix build with DEBUG_LEVEL < 3
authorTobias Brunner <tobias@strongswan.org>
Tue, 18 Apr 2023 14:38:18 +0000 (16:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 May 2023 12:06:43 +0000 (14:06 +0200)
src/libstrongswan/plugins/plugin_loader.c

index 89d3f5de022cf361317c3899370c08cd160c68b8..30b1aeed082c4bdcc9674ad099dd0808e4b49128 100644 (file)
@@ -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);