Skip to content

Enhancement: Add support for zlib-ng #9

@pmqs

Description

@pmqs

zlib-ng has a zlib compatibility mode.

Build it by enabling ZLIB_COMPAT

cmake -GNinja -DZLIB_COMPAT=ON  ..

Using the zlib-ng versions of zlib.h and libz.so with this module fails with this compilation error.

$ ZLIB_LIB=/media/paul/Linux-Shared/base/git/zlib-ng/build ZLIB_INCLUDE=/media/paul/Linux-Shared/base/git/zlib-ng/build BUILD_ZLIB=0  perl5.32.1 Makefile.PL
$ make
...

"/usr/bin/perl5.32.1" -MExtUtils::Command::MM -e 'cp_nonempty' -- Zlib.bs ../blib/arch/auto/Compress/Raw/Zlib/Zlib.bs 644
x86_64-linux-gnu-gcc -c  -I/media/paul/Linux-Shared/base/git/zlib-ng/build -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings -Werror -O2 -g   -DVERSION=\"2.103\" -DXS_VERSION=\"2.103\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.32/CORE"  -DNO_VIZ -DZ_SOLO   -DGZIP_OS_CODE=3 -DUSE_PPPORT_H Zlib.c
In file included from Zlib.xs:34:
/media/paul/Linux-Shared/base/git/zlib-ng/build/zlib.h:1825:13: error: unknown type name ‘gzFile’
 1825 |    Z_EXTERN gzFile Z_EXPORT gzopen(const char *, const char *);
      |             ^~~~~~
/media/paul/Linux-Shared/base/git/zlib-ng/build/zlib.h:1826:44: error: expected ‘)’ before ‘off_t’
 1826 |    Z_EXTERN z_off_t Z_EXPORT gzseek(gzFile, z_off_t, int);
      |                                            ^
      |                                            )
/media/paul/Linux-Shared/base/git/zlib-ng/build/zlib.h:1827:4: error: parameter names (without types) in function declaration [-Werror]
 1827 |    Z_EXTERN z_off_t Z_EXPORT gztell(gzFile);
      |    ^~~~~~~~
/media/paul/Linux-Shared/base/git/zlib-ng/build/zlib.h:1828:4: error: parameter names (without types) in function declaration [-Werror]
 1828 |    Z_EXTERN z_off_t Z_EXPORT gzoffset(gzFile);
      |    ^~~~~~~~
In file included from Zlib.xs:743:
constants.h: In function ‘constant’:
constants.h:370:18: error: assignment to ‘IV’ {aka ‘long int’} from ‘void *’ makes integer from pointer without a cast [-Werror=int-conversion]
  370 |       *iv_return = Z_NULL;
      |                  ^
cc1: all warnings being treated as errors
make[1]: *** [Makefile:335: Zlib.o] Error 1
make[1]: Leaving directory '/media/paul/Linux-Shared/base/perl/ext/Gzip/Raw-Zlib'
make: *** [Makefile:498: subdirs] Error 2

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions