[ruby/zlib] Fix for older ruby 2.6 or earlier
https://github.com/ruby/zlib/commit/00ead8cb2c
This commit is contained in:
parent
f10c9cb1f2
commit
94db8cda9b
@ -27,6 +27,10 @@
|
|||||||
|
|
||||||
#define RUBY_ZLIB_VERSION "1.0.0"
|
#define RUBY_ZLIB_VERSION "1.0.0"
|
||||||
|
|
||||||
|
#ifndef RB_PASS_CALLED_KEYWORDS
|
||||||
|
# define rb_class_new_instance_kw(argc, argv, klass, kw_splat) rb_class_new_instance(argc, argv, klass)
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef GZIP_SUPPORT
|
#ifndef GZIP_SUPPORT
|
||||||
#define GZIP_SUPPORT 1
|
#define GZIP_SUPPORT 1
|
||||||
#endif
|
#endif
|
||||||
@ -1061,9 +1065,14 @@ zstream_run(struct zstream *z, Bytef *src, long len, int flush)
|
|||||||
}
|
}
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
|
#ifndef RB_NOGVL_UBF_ASYNC_SAFE
|
||||||
|
err = (int)(VALUE)rb_thread_call_without_gvl(zstream_run_func, (void *)&args,
|
||||||
|
zstream_unblock_func, (void *)&args);
|
||||||
|
#else
|
||||||
err = (int)(VALUE)rb_nogvl(zstream_run_func, (void *)&args,
|
err = (int)(VALUE)rb_nogvl(zstream_run_func, (void *)&args,
|
||||||
zstream_unblock_func, (void *)&args,
|
zstream_unblock_func, (void *)&args,
|
||||||
RB_NOGVL_UBF_ASYNC_SAFE);
|
RB_NOGVL_UBF_ASYNC_SAFE);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (flush != Z_FINISH && err == Z_BUF_ERROR
|
if (flush != Z_FINISH && err == Z_BUF_ERROR
|
||||||
&& z->stream.avail_out > 0) {
|
&& z->stream.avail_out > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user