[PATCH] erofs-utils: lib: guard gzran zlib.h inclusion

Matthew Lear
2026-03-17T12:24:57Z

gzran.c unconditionally includes zlib.h which doesn't compile on
systems without zlib.

Signed-off-by: Matthew Lear <matthew.lear@raspberrypi.com>
---
lib/gzran.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/gzran.c b/lib/gzran.c
index dffb20a..bf99796 100644
--- a/lib/gzran.c
+++ b/lib/gzran.c
@@ -6,9 +6,9 @@
#include "erofs/err.h"
#include "liberofs_gzran.h"
#include <stdlib.h>
-#include <zlib.h>

#ifdef HAVE_ZLIB
+#include <zlib.h>
struct erofs_gzran_cutpoint {
u8 window[EROFS_GZRAN_WINSIZE]; /* preceding 32K of uncompressed data */
u64 outpos; /* corresponding offset in uncompressed data */
--
2.43.0