1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/zlib/{extconf.rb, zlib.c): crc32_combine and adler32_combine is

supported on Zlib 1.2.2.1, so check them for old zlib.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2010-01-19 05:14:29 +00:00
parent 4395758903
commit d842fce66e
2 changed files with 11 additions and 0 deletions

View file

@ -56,6 +56,9 @@ if %w'z libz zlib1 zlib zdll'.find {|z| have_library(z, 'deflateReset')} and
$defs.concat(defines.collect{|d|' -D'+d})
have_func('crc32_combine', 'zlib.h')
have_func('adler32_combine', 'zlib.h')
create_makefile('zlib')
end

View file

@ -318,6 +318,7 @@ rb_zlib_adler32(int argc, VALUE *argv, VALUE klass)
return do_checksum(argc, argv, adler32);
}
#ifdef HAVE_ADLER32_COMBINE
/*
* call-seq: Zlib.adler32_combine(adler1, adler2, len2)
*
@ -332,6 +333,9 @@ rb_zlib_adler32_combine(VALUE klass, VALUE adler1, VALUE adler2, VALUE len2)
return ULONG2NUM(
adler32_combine(NUM2ULONG(adler1), NUM2ULONG(adler2), NUM2LONG(len2)));
}
#else
#define rb_zlib_adler32_combine rb_f_notimplement
#endif
/*
* call-seq: Zlib.crc32(string, adler)
@ -348,6 +352,7 @@ rb_zlib_crc32(int argc, VALUE *argv, VALUE klass)
return do_checksum(argc, argv, crc32);
}
#ifdef HAVE_CRC32_COMBINE
/*
* call-seq: Zlib.crc32_combine(crc1, crc2, len2)
*
@ -362,6 +367,9 @@ rb_zlib_crc32_combine(VALUE klass, VALUE crc1, VALUE crc2, VALUE len2)
return ULONG2NUM(
crc32_combine(NUM2ULONG(crc1), NUM2ULONG(crc2), NUM2LONG(len2)));
}
#else
#define rb_zlib_crc32_combine rb_f_notimplement
#endif
/*
* Returns the table for calculating CRC checksum as an array.