]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: compression: remove a warning when no compression lib is used
authorWilly Tarreau <w@1wt.eu>
Wed, 10 Aug 2016 19:17:06 +0000 (21:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 10 Aug 2016 19:17:06 +0000 (21:17 +0200)
This warning appears when building without any compression library :

src/compression.c:143:19: warning: unused function 'init_comp_ctx' [-Wunused-function]
static inline int init_comp_ctx(struct comp_ctx **comp_ctx)
                  ^
src/compression.c:176:19: warning: unused function 'deinit_comp_ctx' [-Wunused-function]
static inline int deinit_comp_ctx(struct comp_ctx **comp_ctx)

No backport is needed.

src/compression.c

index 4e13bae11e266272732a55bc143f8166b64a133a..02ff724c01550ab5dcbc72a5652a104ef10e37ab 100644 (file)
@@ -56,7 +56,6 @@ long zlib_used_memory = 0;
 #endif
 
 unsigned int compress_min_idle = 0;
-static struct pool_head *pool_comp_ctx = NULL;
 
 static int identity_init(struct comp_ctx **comp_ctx, int level);
 static int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
@@ -137,6 +136,8 @@ int comp_append_algo(struct comp *comp, const char *algo)
        return -1;
 }
 
+#if defined(USE_ZLIB) || defined(USE_SLZ)
+static struct pool_head *pool_comp_ctx = NULL;
 /*
  * Alloc the comp_ctx
  */
@@ -186,6 +187,7 @@ static inline int deinit_comp_ctx(struct comp_ctx **comp_ctx)
 #endif
        return 0;
 }
+#endif
 
 
 /****************************