Skip to content

Commit

Permalink
Sync Compress-Raw-Zlib-2.104 into blead
Browse files Browse the repository at this point in the history
This commit synchs into blead versions 2.104 for CPAN distribution:

   Compress-Raw-Zlib

  2.104 13 April 2022

Changes:

* Merge pull request Perl#11 from monkburger/symbol_fix_2
  Fri May 13 07:17:19 2022 +0100
  64aea2d3f78946d7df4096eadfa0d7267f4439a5

* perl_crz -> Perl_crz
  Tue May 3 18:19:24 2022 +0000
  20502e6c2eba8ddcad80b20574e840457c0cb369

* This is a slightly different way to fix pmqs/Compress-Raw-Zlib#8
  Tue May 3 18:06:48 2022 +0000
  d9cd27fb212da7455b6ba44729ca11bb441f3950

* add tests for crc32/adler32_combine
  Mon May 2 16:18:13 2022 +0100
  dcfe9ef439790f1a4fae81cf3eac38cfeb848294
  • Loading branch information
toddr authored and scottchiefbaker committed Nov 3, 2022
1 parent cc8d64c commit 6ece829
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 98 deletions.
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.103.tar.gz',
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.104.tar.gz',
'FILES' => q[cpan/Compress-Raw-Zlib],
'EXCLUDED' => [
qr{^examples/},
Expand Down
2 changes: 1 addition & 1 deletion cpan/Compress-Raw-Zlib/Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ WriteMakefile(
NAME => 'Compress::Raw::Zlib',
VERSION_FROM => 'lib/Compress/Raw/Zlib.pm',
INC => "-I$ZLIB_INCLUDE" ,
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DZ_PREFIX -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
XS => { 'Zlib.xs' => 'Zlib.c'},
'depend' => { 'Makefile' => 'config.in' },
'clean' => { FILES => '*.c constants.h constants.xs' },
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.103';
$VERSION = '2.104';
$XS_VERSION = $VERSION;
$VERSION = eval $VERSION;

Expand Down
50 changes: 45 additions & 5 deletions cpan/Compress-Raw-Zlib/t/02zlib.t
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ BEGIN

my $count = 0 ;
if ($] < 5.005) {
$count = 245 ;
$count = 249 ;
}
elsif ($] >= 5.006) {
$count = 349 ;
$count = 353 ;
}
else {
$count = 304 ;
$count = 308 ;
}

plan tests => $count + $extra;
Expand Down 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)
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
{
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)
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
{
cmp_ok $status, '==', Z_STREAM_END ;
}
Expand Down Expand Up @@ -1077,6 +1077,46 @@ SKIP:

}

SKIP:
{
title "crc32_combine";

skip "crc32_combine needs zlib 1.2.3 or better, you have $Zlib_ver", 1
if ZLIB_VERNUM() < 0x1230 ;

my $first = "1234";
my $second = "5678";

my $crc1 = Compress::Raw::Zlib::crc32($first);
my $crc2 = Compress::Raw::Zlib::crc32($second);

my $composite_crc = Compress::Raw::Zlib::crc32($first . $second);

my $combined_crc = Compress::Raw::Zlib::crc32_combine($crc1, $crc2, length $second);

is $combined_crc, $composite_crc ;
}

SKIP:
{
title "adler32_combine";

skip "adler32_combine needs zlib 1.2.3 or better, you have $Zlib_ver", 1
if ZLIB_VERNUM() < 0x1230 ;

my $first = "1234";
my $second = "5678";

my $adler1 = Compress::Raw::Zlib::adler32($first);
my $adler2 = Compress::Raw::Zlib::adler32($second);

my $composite_adler = Compress::Raw::Zlib::adler32($first . $second);

my $combined_adler = Compress::Raw::Zlib::adler32_combine($adler1, $adler2, length $second);

is $combined_adler, $composite_adler ;
}

if (0)
{
title "RT #122695: sync flush appending extra empty uncompressed block";
Expand Down
168 changes: 84 additions & 84 deletions cpan/Compress-Raw-Zlib/zlib-src/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,46 @@
# define Z_PREFIX_SET

/* all linked symbols and init macros */
# define _dist_code z__dist_code
# define _length_code z__length_code
# define _tr_align z__tr_align
# define _tr_flush_bits z__tr_flush_bits
# define _tr_flush_block z__tr_flush_block
# define _tr_init z__tr_init
# define _tr_stored_block z__tr_stored_block
# define _tr_tally z__tr_tally
# define adler32 z_adler32
# define adler32_combine z_adler32_combine
# define adler32_combine64 z_adler32_combine64
# define adler32_z z_adler32_z
# define _dist_code Perl_crz__dist_code
# define _length_code Perl_crz__length_code
# define _tr_align Perl_crz__tr_align
# define _tr_flush_bits Perl_crz__tr_flush_bits
# define _tr_flush_block Perl_crz__tr_flush_block
# define _tr_init Perl_crz__tr_init
# define _tr_stored_block Perl_crz__tr_stored_block
# define _tr_tally Perl_crz__tr_tally
# define adler32 Perl_crz_adler32
# define adler32_combine Perl_crz_adler32_combine
# define adler32_combine64 Perl_crz_adler32_combine64
# define adler32_z Perl_crz_adler32_z
# ifndef Z_SOLO
# define compress z_compress
# define compress2 z_compress2
# define compressBound z_compressBound
# endif
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
# define deflateCopy z_deflateCopy
# define deflateEnd z_deflateEnd
# define deflateGetDictionary z_deflateGetDictionary
# define deflateInit z_deflateInit
# define deflateInit2 z_deflateInit2
# define deflateInit2_ z_deflateInit2_
# define deflateInit_ z_deflateInit_
# define deflateParams z_deflateParams
# define deflatePending z_deflatePending
# define deflatePrime z_deflatePrime
# define deflateReset z_deflateReset
# define deflateResetKeep z_deflateResetKeep
# define deflateSetDictionary z_deflateSetDictionary
# define deflateSetHeader z_deflateSetHeader
# define deflateTune z_deflateTune
# define deflate_copyright z_deflate_copyright
# define get_crc_table z_get_crc_table
# define crc32 Perl_crz_crc32
# define crc32_combine Perl_crz_crc32_combine
# define crc32_combine64 Perl_crz_crc32_combine64
# define crc32_z Perl_crz_crc32_z
# define deflate Perl_crz_deflate
# define deflateBound Perl_crz_deflateBound
# define deflateCopy Perl_crz_deflateCopy
# define deflateEnd Perl_crz_deflateEnd
# define deflateGetDictionary Perl_crz_deflateGetDictionary
# define deflateInit Perl_crz_deflateInit
# define deflateInit2 Perl_crz_deflateInit2
# define deflateInit2_ Perl_crz_deflateInit2_
# define deflateInit_ Perl_crz_deflateInit_
# define deflateParams Perl_crz_deflateParams
# define deflatePending Perl_crz_deflatePending
# define deflatePrime Perl_crz_deflatePrime
# define deflateReset Perl_crz_deflateReset
# define deflateResetKeep Perl_crz_deflateResetKeep
# define deflateSetDictionary Perl_crz_deflateSetDictionary
# define deflateSetHeader Perl_crz_deflateSetHeader
# define deflateTune Perl_crz_deflateTune
# define deflate_copyright Perl_crz_deflate_copyright
# define get_crc_table Perl_crz_get_crc_table
# ifndef Z_SOLO
# define gz_error z_gz_error
# define gz_intmax z_gz_intmax
Expand Down Expand Up @@ -98,70 +98,70 @@
# define gzvprintf z_gzvprintf
# define gzwrite z_gzwrite
# endif
# define inflate z_inflate
# define inflateBack z_inflateBack
# define inflateBackEnd z_inflateBackEnd
# define inflateBackInit z_inflateBackInit
# define inflateBackInit_ z_inflateBackInit_
# define inflateCodesUsed z_inflateCodesUsed
# define inflateCopy z_inflateCopy
# define inflateEnd z_inflateEnd
# define inflateGetDictionary z_inflateGetDictionary
# define inflateGetHeader z_inflateGetHeader
# define inflateInit z_inflateInit
# define inflateInit2 z_inflateInit2
# define inflateInit2_ z_inflateInit2_
# define inflateInit_ z_inflateInit_
# define inflateMark z_inflateMark
# define inflatePrime z_inflatePrime
# define inflateReset z_inflateReset
# define inflateReset2 z_inflateReset2
# define inflateResetKeep z_inflateResetKeep
# define inflateSetDictionary z_inflateSetDictionary
# define inflateSync z_inflateSync
# define inflateSyncPoint z_inflateSyncPoint
# define inflateUndermine z_inflateUndermine
# define inflateValidate z_inflateValidate
# define inflate_copyright z_inflate_copyright
# define inflate_fast z_inflate_fast
# define inflate_table z_inflate_table
# define inflate Perl_crz_inflate
# define inflateBack Perl_crz_inflateBack
# define inflateBackEnd Perl_crz_inflateBackEnd
# define inflateBackInit Perl_crz_inflateBackInit
# define inflateBackInit_ Perl_crz_inflateBackInit_
# define inflateCodesUsed Perl_crz_inflateCodesUsed
# define inflateCopy Perl_crz_inflateCopy
# define inflateEnd Perl_crz_inflateEnd
# define inflateGetDictionary Perl_crz_inflateGetDictionary
# define inflateGetHeader Perl_crz_inflateGetHeader
# define inflateInit Perl_crz_inflateInit
# define inflateInit2 Perl_crz_inflateInit2
# define inflateInit2_ Perl_crz_inflateInit2_
# define inflateInit_ Perl_crz_inflateInit_
# define inflateMark Perl_crz_inflateMark
# define inflatePrime Perl_crz_inflatePrime
# define inflateReset Perl_crz_inflateReset
# define inflateReset2 Perl_crz_inflateReset2
# define inflateResetKeep Perl_crz_inflateResetKeep
# define inflateSetDictionary Perl_crz_inflateSetDictionary
# define inflateSync Perl_crz_inflateSync
# define inflateSyncPoint Perl_crz_inflateSyncPoint
# define inflateUndermine Perl_crz_inflateUndermine
# define inflateValidate Perl_crz_inflateValidate
# define inflate_copyright Perl_crz_inflate_copyright
# define inflate_fast Perl_crz_inflate_fast
# define inflate_table Perl_crz_inflate_table
# ifndef Z_SOLO
# define uncompress z_uncompress
# define uncompress2 z_uncompress2
# endif
# define zError z_zError
# define zError Perl_crz_zError
# ifndef Z_SOLO
# define zcalloc z_zcalloc
# define zcfree z_zcfree
# endif
# define zlibCompileFlags z_zlibCompileFlags
# define zlibVersion z_zlibVersion
# define zlibCompileFlags Perl_crz_zlibCompileFlags
# define zlibVersion Perl_crz_zlibVersion

/* all zlib typedefs in zlib.h and zconf.h */
# define Byte z_Byte
# define Bytef z_Bytef
# define alloc_func z_alloc_func
# define charf z_charf
# define free_func z_free_func
# define Byte Perl_crz_Byte
# define Bytef Perl_crz_Bytef
# define alloc_func Perl_crz_alloc_func
# define charf Perl_crz_charf
# define free_func Perl_crz_free_func
# ifndef Z_SOLO
# define gzFile z_gzFile
# endif
# define gz_header z_gz_header
# define gz_headerp z_gz_headerp
# define in_func z_in_func
# define intf z_intf
# define out_func z_out_func
# define uInt z_uInt
# define uIntf z_uIntf
# define uLong z_uLong
# define uLongf z_uLongf
# define voidp z_voidp
# define voidpc z_voidpc
# define voidpf z_voidpf
# define gz_header Perl_crz_gz_header
# define gz_headerp Perl_crz_gz_headerp
# define in_func Perl_crz_in_func
# define intf Perl_crz_intf
# define out_func Perl_crz_out_func
# define uInt Perl_crz_uInt
# define uIntf Perl_crz_uIntf
# define uLong Perl_crz_uLong
# define uLongf Perl_crz_uLongf
# define voidp Perl_crz_voidp
# define voidpc Perl_crz_voidpc
# define voidpf Perl_crz_voidpf

/* all zlib structs in zlib.h and zconf.h */
# define gz_header_s z_gz_header_s
# define internal_state z_internal_state
# define gz_header_s Perl_crz_gz_header_s
# define internal_state Perl_crz_internal_state

#endif

Expand Down
12 changes: 6 additions & 6 deletions cpan/Compress-Raw-Zlib/zlib-src/zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1793,17 +1793,17 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
const char *version,
int stream_size));
#ifdef Z_PREFIX_SET
# define z_deflateInit(strm, level) \
# define Perl_crz_deflateInit(strm, level) \
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_inflateInit(strm) \
# define Perl_crz_inflateInit(strm) \
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
# define Perl_crz_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
# define z_inflateInit2(strm, windowBits) \
# define Perl_crz_inflateInit2(strm, windowBits) \
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
(int)sizeof(z_stream))
# define z_inflateBackInit(strm, windowBits, window) \
# define Perl_crz_inflateBackInit(strm, windowBits, window) \
inflateBackInit_((strm), (windowBits), (window), \
ZLIB_VERSION, (int)sizeof(z_stream))
#else
Expand Down Expand Up @@ -1839,7 +1839,7 @@ struct gzFile_s {
ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
#ifdef Z_PREFIX_SET
# undef z_gzgetc
# define z_gzgetc(g) \
# define Perl_crz_gzgetc(g) \
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
#else
# define gzgetc(g) \
Expand Down

0 comments on commit 6ece829

Please sign in to comment.