Skip to content

Commit c8326bf

Browse files
toddrrjbs
authored andcommitted
Sync Compress-Raw-Zlib-2.104 into blead
This commit synchs into blead versions 2.104 for CPAN distribution: Compress-Raw-Zlib 2.104 13 April 2022 Changes: * Merge pull request #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
1 parent 2d31a53 commit c8326bf

File tree

6 files changed

+138
-98
lines changed

6 files changed

+138
-98
lines changed

Porting/Maintainers.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ package Maintainers;
216216
},
217217

218218
'Compress::Raw::Zlib' => {
219-
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.103.tar.gz',
219+
'DISTRIBUTION' => 'PMQS/Compress-Raw-Zlib-2.104.tar.gz',
220220
'FILES' => q[cpan/Compress-Raw-Zlib],
221221
'EXCLUDED' => [
222222
qr{^examples/},

cpan/Compress-Raw-Zlib/Makefile.PL

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ WriteMakefile(
7575
NAME => 'Compress::Raw::Zlib',
7676
VERSION_FROM => 'lib/Compress/Raw/Zlib.pm',
7777
INC => "-I$ZLIB_INCLUDE" ,
78-
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
78+
DEFINE => "-DNO_VIZ -DZ_SOLO $OLD_ZLIB $WALL -DZ_PREFIX -DGZIP_OS_CODE=$GZIP_OS_CODE $USE_PPPORT_H" ,
7979
XS => { 'Zlib.xs' => 'Zlib.c'},
8080
'depend' => { 'Makefile' => 'config.in' },
8181
'clean' => { FILES => '*.c constants.h constants.xs' },

cpan/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use warnings ;
1010
use bytes ;
1111
our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS);
1212

13-
$VERSION = '2.103';
13+
$VERSION = '2.104';
1414
$XS_VERSION = $VERSION;
1515
$VERSION = eval $VERSION;
1616

cpan/Compress-Raw-Zlib/t/02zlib.t

+45-5
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ BEGIN
2525

2626
my $count = 0 ;
2727
if ($] < 5.005) {
28-
$count = 245 ;
28+
$count = 249 ;
2929
}
3030
elsif ($] >= 5.006) {
31-
$count = 349 ;
31+
$count = 353 ;
3232
}
3333
else {
34-
$count = 304 ;
34+
$count = 308 ;
3535
}
3636

3737
plan tests => $count + $extra;
@@ -492,7 +492,7 @@ SKIP:
492492
}
493493

494494
# Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
495-
if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
495+
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
496496
{
497497
cmp_ok $status, '==', Z_STREAM_END ;
498498
}
@@ -526,7 +526,7 @@ SKIP:
526526
$GOT = '';
527527
$status = $k->inflate($rest, $GOT);
528528
# Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib
529-
if (ZLIB_VERNUM >= ZLIB_1_2_12_0)
529+
if (ZLIB_VERNUM >= ZLIB_1_2_12_0 || Compress::Raw::Zlib::haveZlibNg())
530530
{
531531
cmp_ok $status, '==', Z_STREAM_END ;
532532
}
@@ -1077,6 +1077,46 @@ SKIP:
10771077

10781078
}
10791079

1080+
SKIP:
1081+
{
1082+
title "crc32_combine";
1083+
1084+
skip "crc32_combine needs zlib 1.2.3 or better, you have $Zlib_ver", 1
1085+
if ZLIB_VERNUM() < 0x1230 ;
1086+
1087+
my $first = "1234";
1088+
my $second = "5678";
1089+
1090+
my $crc1 = Compress::Raw::Zlib::crc32($first);
1091+
my $crc2 = Compress::Raw::Zlib::crc32($second);
1092+
1093+
my $composite_crc = Compress::Raw::Zlib::crc32($first . $second);
1094+
1095+
my $combined_crc = Compress::Raw::Zlib::crc32_combine($crc1, $crc2, length $second);
1096+
1097+
is $combined_crc, $composite_crc ;
1098+
}
1099+
1100+
SKIP:
1101+
{
1102+
title "adler32_combine";
1103+
1104+
skip "adler32_combine needs zlib 1.2.3 or better, you have $Zlib_ver", 1
1105+
if ZLIB_VERNUM() < 0x1230 ;
1106+
1107+
my $first = "1234";
1108+
my $second = "5678";
1109+
1110+
my $adler1 = Compress::Raw::Zlib::adler32($first);
1111+
my $adler2 = Compress::Raw::Zlib::adler32($second);
1112+
1113+
my $composite_adler = Compress::Raw::Zlib::adler32($first . $second);
1114+
1115+
my $combined_adler = Compress::Raw::Zlib::adler32_combine($adler1, $adler2, length $second);
1116+
1117+
is $combined_adler, $composite_adler ;
1118+
}
1119+
10801120
if (0)
10811121
{
10821122
title "RT #122695: sync flush appending extra empty uncompressed block";

cpan/Compress-Raw-Zlib/zlib-src/zconf.h

+84-84
Original file line numberDiff line numberDiff line change
@@ -18,46 +18,46 @@
1818
# define Z_PREFIX_SET
1919

2020
/* all linked symbols and init macros */
21-
# define _dist_code z__dist_code
22-
# define _length_code z__length_code
23-
# define _tr_align z__tr_align
24-
# define _tr_flush_bits z__tr_flush_bits
25-
# define _tr_flush_block z__tr_flush_block
26-
# define _tr_init z__tr_init
27-
# define _tr_stored_block z__tr_stored_block
28-
# define _tr_tally z__tr_tally
29-
# define adler32 z_adler32
30-
# define adler32_combine z_adler32_combine
31-
# define adler32_combine64 z_adler32_combine64
32-
# define adler32_z z_adler32_z
21+
# define _dist_code Perl_crz__dist_code
22+
# define _length_code Perl_crz__length_code
23+
# define _tr_align Perl_crz__tr_align
24+
# define _tr_flush_bits Perl_crz__tr_flush_bits
25+
# define _tr_flush_block Perl_crz__tr_flush_block
26+
# define _tr_init Perl_crz__tr_init
27+
# define _tr_stored_block Perl_crz__tr_stored_block
28+
# define _tr_tally Perl_crz__tr_tally
29+
# define adler32 Perl_crz_adler32
30+
# define adler32_combine Perl_crz_adler32_combine
31+
# define adler32_combine64 Perl_crz_adler32_combine64
32+
# define adler32_z Perl_crz_adler32_z
3333
# ifndef Z_SOLO
3434
# define compress z_compress
3535
# define compress2 z_compress2
3636
# define compressBound z_compressBound
3737
# endif
38-
# define crc32 z_crc32
39-
# define crc32_combine z_crc32_combine
40-
# define crc32_combine64 z_crc32_combine64
41-
# define crc32_z z_crc32_z
42-
# define deflate z_deflate
43-
# define deflateBound z_deflateBound
44-
# define deflateCopy z_deflateCopy
45-
# define deflateEnd z_deflateEnd
46-
# define deflateGetDictionary z_deflateGetDictionary
47-
# define deflateInit z_deflateInit
48-
# define deflateInit2 z_deflateInit2
49-
# define deflateInit2_ z_deflateInit2_
50-
# define deflateInit_ z_deflateInit_
51-
# define deflateParams z_deflateParams
52-
# define deflatePending z_deflatePending
53-
# define deflatePrime z_deflatePrime
54-
# define deflateReset z_deflateReset
55-
# define deflateResetKeep z_deflateResetKeep
56-
# define deflateSetDictionary z_deflateSetDictionary
57-
# define deflateSetHeader z_deflateSetHeader
58-
# define deflateTune z_deflateTune
59-
# define deflate_copyright z_deflate_copyright
60-
# define get_crc_table z_get_crc_table
38+
# define crc32 Perl_crz_crc32
39+
# define crc32_combine Perl_crz_crc32_combine
40+
# define crc32_combine64 Perl_crz_crc32_combine64
41+
# define crc32_z Perl_crz_crc32_z
42+
# define deflate Perl_crz_deflate
43+
# define deflateBound Perl_crz_deflateBound
44+
# define deflateCopy Perl_crz_deflateCopy
45+
# define deflateEnd Perl_crz_deflateEnd
46+
# define deflateGetDictionary Perl_crz_deflateGetDictionary
47+
# define deflateInit Perl_crz_deflateInit
48+
# define deflateInit2 Perl_crz_deflateInit2
49+
# define deflateInit2_ Perl_crz_deflateInit2_
50+
# define deflateInit_ Perl_crz_deflateInit_
51+
# define deflateParams Perl_crz_deflateParams
52+
# define deflatePending Perl_crz_deflatePending
53+
# define deflatePrime Perl_crz_deflatePrime
54+
# define deflateReset Perl_crz_deflateReset
55+
# define deflateResetKeep Perl_crz_deflateResetKeep
56+
# define deflateSetDictionary Perl_crz_deflateSetDictionary
57+
# define deflateSetHeader Perl_crz_deflateSetHeader
58+
# define deflateTune Perl_crz_deflateTune
59+
# define deflate_copyright Perl_crz_deflate_copyright
60+
# define get_crc_table Perl_crz_get_crc_table
6161
# ifndef Z_SOLO
6262
# define gz_error z_gz_error
6363
# define gz_intmax z_gz_intmax
@@ -98,70 +98,70 @@
9898
# define gzvprintf z_gzvprintf
9999
# define gzwrite z_gzwrite
100100
# endif
101-
# define inflate z_inflate
102-
# define inflateBack z_inflateBack
103-
# define inflateBackEnd z_inflateBackEnd
104-
# define inflateBackInit z_inflateBackInit
105-
# define inflateBackInit_ z_inflateBackInit_
106-
# define inflateCodesUsed z_inflateCodesUsed
107-
# define inflateCopy z_inflateCopy
108-
# define inflateEnd z_inflateEnd
109-
# define inflateGetDictionary z_inflateGetDictionary
110-
# define inflateGetHeader z_inflateGetHeader
111-
# define inflateInit z_inflateInit
112-
# define inflateInit2 z_inflateInit2
113-
# define inflateInit2_ z_inflateInit2_
114-
# define inflateInit_ z_inflateInit_
115-
# define inflateMark z_inflateMark
116-
# define inflatePrime z_inflatePrime
117-
# define inflateReset z_inflateReset
118-
# define inflateReset2 z_inflateReset2
119-
# define inflateResetKeep z_inflateResetKeep
120-
# define inflateSetDictionary z_inflateSetDictionary
121-
# define inflateSync z_inflateSync
122-
# define inflateSyncPoint z_inflateSyncPoint
123-
# define inflateUndermine z_inflateUndermine
124-
# define inflateValidate z_inflateValidate
125-
# define inflate_copyright z_inflate_copyright
126-
# define inflate_fast z_inflate_fast
127-
# define inflate_table z_inflate_table
101+
# define inflate Perl_crz_inflate
102+
# define inflateBack Perl_crz_inflateBack
103+
# define inflateBackEnd Perl_crz_inflateBackEnd
104+
# define inflateBackInit Perl_crz_inflateBackInit
105+
# define inflateBackInit_ Perl_crz_inflateBackInit_
106+
# define inflateCodesUsed Perl_crz_inflateCodesUsed
107+
# define inflateCopy Perl_crz_inflateCopy
108+
# define inflateEnd Perl_crz_inflateEnd
109+
# define inflateGetDictionary Perl_crz_inflateGetDictionary
110+
# define inflateGetHeader Perl_crz_inflateGetHeader
111+
# define inflateInit Perl_crz_inflateInit
112+
# define inflateInit2 Perl_crz_inflateInit2
113+
# define inflateInit2_ Perl_crz_inflateInit2_
114+
# define inflateInit_ Perl_crz_inflateInit_
115+
# define inflateMark Perl_crz_inflateMark
116+
# define inflatePrime Perl_crz_inflatePrime
117+
# define inflateReset Perl_crz_inflateReset
118+
# define inflateReset2 Perl_crz_inflateReset2
119+
# define inflateResetKeep Perl_crz_inflateResetKeep
120+
# define inflateSetDictionary Perl_crz_inflateSetDictionary
121+
# define inflateSync Perl_crz_inflateSync
122+
# define inflateSyncPoint Perl_crz_inflateSyncPoint
123+
# define inflateUndermine Perl_crz_inflateUndermine
124+
# define inflateValidate Perl_crz_inflateValidate
125+
# define inflate_copyright Perl_crz_inflate_copyright
126+
# define inflate_fast Perl_crz_inflate_fast
127+
# define inflate_table Perl_crz_inflate_table
128128
# ifndef Z_SOLO
129129
# define uncompress z_uncompress
130130
# define uncompress2 z_uncompress2
131131
# endif
132-
# define zError z_zError
132+
# define zError Perl_crz_zError
133133
# ifndef Z_SOLO
134134
# define zcalloc z_zcalloc
135135
# define zcfree z_zcfree
136136
# endif
137-
# define zlibCompileFlags z_zlibCompileFlags
138-
# define zlibVersion z_zlibVersion
137+
# define zlibCompileFlags Perl_crz_zlibCompileFlags
138+
# define zlibVersion Perl_crz_zlibVersion
139139

140140
/* all zlib typedefs in zlib.h and zconf.h */
141-
# define Byte z_Byte
142-
# define Bytef z_Bytef
143-
# define alloc_func z_alloc_func
144-
# define charf z_charf
145-
# define free_func z_free_func
141+
# define Byte Perl_crz_Byte
142+
# define Bytef Perl_crz_Bytef
143+
# define alloc_func Perl_crz_alloc_func
144+
# define charf Perl_crz_charf
145+
# define free_func Perl_crz_free_func
146146
# ifndef Z_SOLO
147147
# define gzFile z_gzFile
148148
# endif
149-
# define gz_header z_gz_header
150-
# define gz_headerp z_gz_headerp
151-
# define in_func z_in_func
152-
# define intf z_intf
153-
# define out_func z_out_func
154-
# define uInt z_uInt
155-
# define uIntf z_uIntf
156-
# define uLong z_uLong
157-
# define uLongf z_uLongf
158-
# define voidp z_voidp
159-
# define voidpc z_voidpc
160-
# define voidpf z_voidpf
149+
# define gz_header Perl_crz_gz_header
150+
# define gz_headerp Perl_crz_gz_headerp
151+
# define in_func Perl_crz_in_func
152+
# define intf Perl_crz_intf
153+
# define out_func Perl_crz_out_func
154+
# define uInt Perl_crz_uInt
155+
# define uIntf Perl_crz_uIntf
156+
# define uLong Perl_crz_uLong
157+
# define uLongf Perl_crz_uLongf
158+
# define voidp Perl_crz_voidp
159+
# define voidpc Perl_crz_voidpc
160+
# define voidpf Perl_crz_voidpf
161161

162162
/* all zlib structs in zlib.h and zconf.h */
163-
# define gz_header_s z_gz_header_s
164-
# define internal_state z_internal_state
163+
# define gz_header_s Perl_crz_gz_header_s
164+
# define internal_state Perl_crz_internal_state
165165

166166
#endif
167167

cpan/Compress-Raw-Zlib/zlib-src/zlib.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -1793,17 +1793,17 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
17931793
const char *version,
17941794
int stream_size));
17951795
#ifdef Z_PREFIX_SET
1796-
# define z_deflateInit(strm, level) \
1796+
# define Perl_crz_deflateInit(strm, level) \
17971797
deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
1798-
# define z_inflateInit(strm) \
1798+
# define Perl_crz_inflateInit(strm) \
17991799
inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
1800-
# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
1800+
# define Perl_crz_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
18011801
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
18021802
(strategy), ZLIB_VERSION, (int)sizeof(z_stream))
1803-
# define z_inflateInit2(strm, windowBits) \
1803+
# define Perl_crz_inflateInit2(strm, windowBits) \
18041804
inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
18051805
(int)sizeof(z_stream))
1806-
# define z_inflateBackInit(strm, windowBits, window) \
1806+
# define Perl_crz_inflateBackInit(strm, windowBits, window) \
18071807
inflateBackInit_((strm), (windowBits), (window), \
18081808
ZLIB_VERSION, (int)sizeof(z_stream))
18091809
#else
@@ -1839,7 +1839,7 @@ struct gzFile_s {
18391839
ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
18401840
#ifdef Z_PREFIX_SET
18411841
# undef z_gzgetc
1842-
# define z_gzgetc(g) \
1842+
# define Perl_crz_gzgetc(g) \
18431843
((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
18441844
#else
18451845
# define gzgetc(g) \

0 commit comments

Comments
 (0)