Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Porting/Maintainers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ package Maintainers;
},

'Compress::Raw::Zlib' => {
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.104.tar.gz',
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.105.tar.gz',
'FILES' => q[cpan/Compress-Raw-Zlib],
'EXCLUDED' => [
qr{^examples/},
Expand Down
22 changes: 19 additions & 3 deletions cpan/Compress-Raw-Zlib/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,27 @@ ParseCONFIG() ;
UpDowngrade(getPerlFiles('MANIFEST'))
unless $ENV{PERL_CORE};

my $OPT_Z_PREFIX = '-DZ_PREFIX' ;
my $OPT_ZLIB_INCLUDE = "-I$ZLIB_INCLUDE";
my $OPT_ZLIB_LIB = "-L$ZLIB_LIB" ;

if (! $BUILD_ZLIB)
{
# When using the system supplied zlib, we don't want to use our bespoke prefix
$OPT_Z_PREFIX = '';

$OPT_ZLIB_INCLUDE = ''
if $ZLIB_INCLUDE eq './zlib-src' ;

$OPT_ZLIB_LIB = ''
if $ZLIB_LIB eq './zlib-src' ;
}

WriteMakefile(
NAME => 'Compress::Raw::Zlib',
VERSION_FROM => 'lib/Compress/Raw/Zlib.pm',
INC => "-I$ZLIB_INCLUDE" ,
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DZ_PREFIX -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
INC => $OPT_ZLIB_INCLUDE ,
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL $OPT_Z_PREFIX -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H -DPerl_crz_BUILD_ZLIB=$BUILD_ZLIB" ,
XS => { 'Zlib.xs' => 'Zlib.c'},
'depend' => { 'Makefile' => 'config.in' },
'clean' => { FILES => '*.c constants.h constants.xs' },
Expand All @@ -88,7 +104,7 @@ WriteMakefile(
(
$BUILD_ZLIB
? zlib_files($ZLIB_LIB)
: (LIBS => [ "-L$ZLIB_LIB -l$ZLIB_LIBRARY_NAME " ])
: (LIBS => [ "$OPT_ZLIB_LIB -l$ZLIB_LIBRARY_NAME " ])
),
OPTIMIZE => $OPTIMIZE,

Expand Down
9 changes: 7 additions & 2 deletions cpan/Compress-Raw-Zlib/Zlib.xs
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,12 @@ BOOT:
sv_setiv(os_code_sv, GZIP_OS_CODE) ;
}

{
/* BUILD_ZLIB */
SV * os_code_sv = perl_get_sv("Compress::Raw::Zlib::BUILD_ZLIB", GV_ADDMULTI) ;
sv_setiv(os_code_sv, Perl_crz_BUILD_ZLIB) ;
}


#define Zip_zlib_version() (const char*)zlib_version
const char*
Expand Down Expand Up @@ -1142,8 +1148,7 @@ deflate (s, buf, output)
if (RETVAL != Z_STREAM_ERROR) {
int done = increment - s->stream.avail_out ;
printf("std DEFLATEr returned %d '%s' avail in %d, out %d wrote %d\n", RETVAL,
GetErrorString(RETVAL), s->stream.avail_in,
s->stream.avail_out, done);
GetErrorString(RETVAL), s->stream.avail_in, s->stream.avail_out, done);
}
*/

Expand Down
2 changes: 1 addition & 1 deletion cpan/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use warnings ;
use bytes ;
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS);

$VERSION = '2.104';
$VERSION = '2.105';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down
75 changes: 75 additions & 0 deletions cpan/Compress-Raw-Zlib/t/01version.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,86 @@ BEGIN
use_ok('Compress::Raw::Zlib', 2) ;
}

sub bit
{
return 1 << $_[0];
}

{

my $zlib_h = ZLIB_VERSION ;
my $libz = Compress::Raw::Zlib::zlib_version;
my $ZLIB_VERNUM = sprintf ("0x%X", Compress::Raw::Zlib::ZLIB_VERNUM()) ;
my $flags = Compress::Raw::Zlib::zlibCompileFlags();

my %sizes = (
0 => '16 bit',
1 => '32 bit',
2 => '64 bit',
3 => 'other'
);
my $uIntSize = $sizes{ ($flags >> 0) & 0x3 };
my $uLongSize = $sizes{ ($flags >> 2) & 0x3 };
my $pointerSize = $sizes{ ($flags >> 4) & 0x3 };
my $zOffSize = $sizes{ ($flags >> 6) & 0x3 };

my @compiler_options;
push @compiler_options, 'ZLIB_DEBUG' if $flags & bit(8) ;
push @compiler_options, 'ASM' if $flags & bit(9) ;
push @compiler_options, 'ZLIB_WINAPI' if $flags & bit(10) ;
push @compiler_options, 'None' unless @compiler_options;
my $compiler_options = join ", ", @compiler_options;

my @one_time;
push @one_time, 'BUILDFIXED' if $flags & bit(12) ;
push @one_time, 'DYNAMIC_CRC_TABLE' if $flags & bit(13) ;
push @one_time, 'None' unless @one_time;
my $one_time = join ", ", @one_time;

my @library;
push @library, 'NO_GZCOMPRESS' if $flags & bit(16) ;
push @library, 'NO_GZIP' if $flags & bit(17) ;
push @library, 'None' unless @library;
my $library = join ", ", @library;

my @operational;
push @operational, 'PKZIP_BUG_WORKAROUND' if $flags & bit(20) ;
push @operational, 'FASTEST' if $flags & bit(21) ;
push @operational, 'None' unless @operational;
my $operational = join ", ", @operational;

diag <<EOM ;


Compress::Raw::Zlib::VERSION $Compress::Raw::Zlib::VERSION

ZLIB_VERSION (from zlib.h) $zlib_h
zlib_version (from zlib library) $libz

ZLIB_VERNUM $ZLIB_VERNUM
BUILD_ZLIB $Compress::Raw::Zlib::BUILD_ZLIB
GZIP_OS_CODE $Compress::Raw::Zlib::gzip_os_code

zlibCompileFlags $flags
Type Sizes
size of uInt $uIntSize
size of uLong $uLongSize
size of pointer $pointerSize
size of z_off_t $zOffSize
Compiler Options $compiler_options
One-time table building $one_time
Library content $library
Operation variations $operational

EOM
}

# Check zlib_version and ZLIB_VERSION are the same.

SKIP: {
skip "TEST_SKIP_VERSION_CHECK is set", 1
if $ENV{TEST_SKIP_VERSION_CHECK};

my $zlib_h = ZLIB_VERSION ;
my $libz = Compress::Raw::Zlib::zlib_version;

Expand Down
4 changes: 2 additions & 2 deletions cpan/Compress-Raw-Zlib/t/02zlib.t
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ SKIP:
}

# Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
{
cmp_ok $status, '==', Z_STREAM_END ;
}
Expand Down Expand Up @@ -526,7 +526,7 @@ SKIP:
$GOT = '';
$status = $k->inflate($rest, $GOT);
# Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 )
{
cmp_ok $status, '==', Z_STREAM_END ;
}
Expand Down