zlib 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5256d7574d4fcaf95d85282fb08608413d86ebd4818db7cde168441b0c3872a
4
- data.tar.gz: 51c94357b975da64fecb9aa6a7d76ecfe465de32beba7d9c7e2f3b16ffa7c2e7
3
+ metadata.gz: 5a142899fbd58686f35175f42086f71f273cc7d286d01a9bb78ff8bd11e408cb
4
+ data.tar.gz: f734de045270183857df81bf0996ab49d59eb5ff5999ca9d334d688ba50a06b8
5
5
  SHA512:
6
- metadata.gz: ae90c906532814044b416cfec733b13409b99a6bb2e32d3a4aa2f18f068327442dde8b5c4898b556bc0905bb61de9211a8cc9a014e95d39f09343be0de377f3c
7
- data.tar.gz: 1e43996f98659c4718cfb02650fb473666d779d8b45aa42cd287cc7bd42d09723b7fc8dac30f48ae4e348901fa473bca7b197c00feefc081276844712d18efed
6
+ metadata.gz: b7fa3e4abea3e1ca2ee1f02ff5ebf57cdc1fb3ef43a8220a2fe2cfadae9e63ce95790092251bd790d90dd6a38e4645449ec67ac0e737b7b8c0b6870c797e5017
7
+ data.tar.gz: 15bb4093a7645e09a3dddc209dab70ad9ea550086439867c230fb14eeeb64113518bd7c4c23f1ee64140fc6e82bc6c548d35f65dc9668d314b4659536541a99c
data/ext/zlib/extconf.rb CHANGED
@@ -11,10 +11,9 @@ require 'rbconfig'
11
11
  dir_config 'zlib'
12
12
 
13
13
  libs = $libs
14
- if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and
15
- have_header('zlib.h') then
16
- have_zlib = true
17
- else
14
+ have_zlib = %w'z libz zlib1 zlib zdll zlibwapi'.any? {|z| have_library(z, 'deflateReset(NULL)', 'zlib.h')}
15
+
16
+ unless have_zlib
18
17
  $libs = libs
19
18
  unless File.directory?(zsrc = "#{$srcdir}/zlib")
20
19
  dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}}
@@ -121,12 +120,18 @@ if have_zlib
121
120
  $defs << "-DHAVE_CRC32_COMBINE"
122
121
  $defs << "-DHAVE_ADLER32_COMBINE"
123
122
  $defs << "-DHAVE_TYPE_Z_CRC_T"
124
- $defs << "-DHAVE_TYPE_Z_SIZE_T"
123
+ $defs << "-DHAVE_CRC32_Z"
124
+ $defs << "-DHAVE_ADLER32_Z"
125
+ $defs << "-DHAVE_ZLIB_SIZE_T_FUNCS"
125
126
  else
126
127
  have_func('crc32_combine', 'zlib.h')
127
128
  have_func('adler32_combine', 'zlib.h')
128
129
  have_type('z_crc_t', 'zlib.h')
129
- have_type('z_size_t', 'zlib.h')
130
+ if (have_type('z_size_t', 'zlib.h') &&
131
+ have_func('crc32_z', 'zlib.h') &&
132
+ have_func('adler32_z', 'zlib.h'))
133
+ $defs << "-DHAVE_ZLIB_SIZE_T_FUNCS"
134
+ end
130
135
  end
131
136
 
132
137
  create_makefile('zlib') {|conf|
data/ext/zlib/zlib.c CHANGED
@@ -25,7 +25,7 @@
25
25
  # define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
26
26
  #endif
27
27
 
28
- #define RUBY_ZLIB_VERSION "3.0.1"
28
+ #define RUBY_ZLIB_VERSION "3.1.0"
29
29
 
30
30
  #ifndef RB_PASS_CALLED_KEYWORDS
31
31
  # define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
@@ -44,7 +44,7 @@
44
44
  #endif
45
45
  #endif
46
46
 
47
- #if defined(HAVE_TYPE_Z_SIZE_T)
47
+ #if defined(HAVE_ZLIB_SIZE_T_FUNCS)
48
48
  typedef uLong (*checksum_func)(uLong, const Bytef*, z_size_t);
49
49
  # define crc32 crc32_z
50
50
  # define adler32 adler32_z
@@ -388,7 +388,7 @@ rb_zlib_version(VALUE klass)
388
388
  # define mask32(x) (x)
389
389
  #endif
390
390
 
391
- #if SIZEOF_LONG > SIZEOF_INT && !defined(HAVE_TYPE_Z_SIZE_T)
391
+ #if SIZEOF_LONG > SIZEOF_INT && !defined(HAVE_ZLIB_SIZE_T_FUNCS)
392
392
  static uLong
393
393
  checksum_long(uLong (*func)(uLong, const Bytef*, uInt), uLong sum, const Bytef *ptr, long len)
394
394
  {
@@ -851,7 +851,9 @@ zstream_buffer_ungets(struct zstream *z, const Bytef *b, unsigned long len)
851
851
  char *bufptr;
852
852
  long filled;
853
853
 
854
- zstream_expand_buffer_into(z, len);
854
+ if (NIL_P(z->buf) || (long)rb_str_capacity(z->buf) <= ZSTREAM_BUF_FILLED(z)) {
855
+ zstream_expand_buffer_into(z, len);
856
+ }
855
857
 
856
858
  RSTRING_GETMEM(z->buf, bufptr, filled);
857
859
  memmove(bufptr + len, bufptr, filled);
@@ -921,7 +923,7 @@ zstream_discard_input(struct zstream *z, long len)
921
923
  z->input = Qnil;
922
924
  }
923
925
  else {
924
- z->input = rb_str_substr(z->input, len,
926
+ z->input = rb_str_subseq(z->input, len,
925
927
  RSTRING_LEN(z->input) - len);
926
928
  }
927
929
  }
data/zlib.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = []
28
28
  spec.require_paths = ["lib"]
29
29
  spec.extensions = "ext/zlib/extconf.rb"
30
- spec.required_ruby_version = ">= 2.3.0"
30
+ spec.required_ruby_version = ">= 2.5.0"
31
31
  end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yukihiro Matsumoto
8
8
  - UENO Katsuhiro
9
+ autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 1980-01-02 00:00:00.000000000 Z
12
+ date: 2023-11-07 00:00:00.000000000 Z
12
13
  dependencies: []
13
14
  description: Ruby interface for the zlib compression/decompression library
14
15
  email:
@@ -29,6 +30,7 @@ licenses:
29
30
  - Ruby
30
31
  - BSD-2-Clause
31
32
  metadata: {}
33
+ post_install_message:
32
34
  rdoc_options: []
33
35
  require_paths:
34
36
  - lib
@@ -36,14 +38,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
36
38
  requirements:
37
39
  - - ">="
38
40
  - !ruby/object:Gem::Version
39
- version: 2.3.0
41
+ version: 2.5.0
40
42
  required_rubygems_version: !ruby/object:Gem::Requirement
41
43
  requirements:
42
44
  - - ">="
43
45
  - !ruby/object:Gem::Version
44
46
  version: '0'
45
47
  requirements: []
46
- rubygems_version: 4.0.3
48
+ rubygems_version: 3.5.0.dev
49
+ signing_key:
47
50
  specification_version: 4
48
51
  summary: Ruby interface for the zlib compression/decompression library
49
52
  test_files: []