Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions ext/zlib/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,23 @@
#ifndef HAVE_RB_LEN_T
typedef long rb_len_t;
typedef unsigned long rb_ulen_t;
#endif
#ifndef SIZEOF_RB_LEN_T
# define SIZEOF_RB_LEN_T SIZEOF_LONG
#endif
#ifndef LEN2NUM
# define LEN2NUM LONG2NUM
#endif
#ifndef ULEN2NUM
# define ULEN2NUM ULONG2NUM
#endif
#ifndef NUM2LEN
# define NUM2LEN NUM2LONG
#endif
#ifndef NUM2ULEN
# define NUM2ULEN NUM2ULONG
#endif
#ifndef PRIdLEN
# define PRIdLEN "ld"
#endif

Expand Down Expand Up @@ -532,8 +546,8 @@ rb_zlib_crc32(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_zlib_crc32_combine(VALUE klass, VALUE crc1, VALUE crc2, VALUE len2)
{
return ULONG2NUM(
crc32_combine(NUM2ULONG(crc1), NUM2ULONG(crc2), NUM2LONG(len2)));
return ULEN2NUM(
crc32_combine(NUM2ULONG(crc1), NUM2ULONG(crc2), NUM2ULEN(len2)));
}
#else
#define rb_zlib_crc32_combine rb_f_notimplement
Expand Down