From ee5c80732095c81fb6b3641414ee317f6abedb42 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Tue, 5 Nov 2019 02:02:14 +0900 Subject: [PATCH] Adjust a fucntion signature --- ext/zlib/zlib.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 2d93819..23466d1 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -4277,13 +4277,19 @@ rb_gzreader_external_encoding(VALUE self) } static VALUE -zlib_gzip_ensure(VALUE arg) +zlib_gzip_end_rescue(VALUE arg) { struct gzfile *gz = (struct gzfile *)arg; - rb_rescue((VALUE(*)())gz->end, arg, NULL, Qnil); + gz->end(gz); return Qnil; } +static VALUE +zlib_gzip_ensure(VALUE arg) +{ + return rb_rescue(zlib_gzip_end_rescue, arg, NULL, Qnil); +} + static void zlib_gzip_end(struct gzfile *gz) {