From 3f73bfb3e09c407425245aa5f62477fd572328c9 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 18 Feb 2024 13:52:42 +0100 Subject: Make it possible to compile jffsX-utils without zlib The jffsX-utils already have a CONFIG_JFFS2_ZLIB define, but it is statically defined in a header and not used consistently. This patch first replaces it with a "WITH_ZLIB" define, provided via automake, to bring it in line with the already existing "WITH_LZO". Then, the missing checks and typedefs are added in jffs2reader.c. Signed-off-by: David Oberhollenzer --- jffsX-utils/jffs2reader.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'jffsX-utils/jffs2reader.c') diff --git a/jffsX-utils/jffs2reader.c b/jffsX-utils/jffs2reader.c index 33c5577..87a2167 100644 --- a/jffsX-utils/jffs2reader.c +++ b/jffsX-utils/jffs2reader.c @@ -75,7 +75,11 @@ BUGS: #include #include #include +#ifdef WITH_ZLIB #include +#else +typedef unsigned long uLongf; +#endif #include "mtd/jffs2-user.h" #include "common.h" @@ -132,12 +136,13 @@ static void putblock(char *b, size_t bsize, size_t * rsize, bzero(b + *rsize, je32_to_cpu(n->isize) - *rsize); switch (n->compr) { +#ifdef WITH_ZLIB case JFFS2_COMPR_ZLIB: uncompress((Bytef *) b + je32_to_cpu(n->offset), &dlen, (Bytef *) ((char *) n) + sizeof(struct jffs2_raw_inode), (uLongf) je32_to_cpu(n->csize)); break; - +#endif case JFFS2_COMPR_NONE: memcpy(b + je32_to_cpu(n->offset), ((char *) n) + sizeof(struct jffs2_raw_inode), dlen); -- cgit v1.2.3