ruby-changes:14516
From: usa <ko1@a...>
Date: Tue, 19 Jan 2010 14:14:40 +0900 (JST)
Subject: [ruby-changes:14516] Ruby:r26353 (trunk): * ext/zlib/{extconf.rb, zlib.c): crc32_combine and adler32_combine is
usa 2010-01-19 14:14:29 +0900 (Tue, 19 Jan 2010) New Revision: 26353 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26353 Log: * 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. Modified files: trunk/ext/zlib/extconf.rb trunk/ext/zlib/zlib.c Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 26352) +++ ext/zlib/zlib.c (revision 26353) @@ -318,6 +318,7 @@ return do_checksum(argc, argv, adler32); } +#ifdef HAVE_ADLER32_COMBINE /* * call-seq: Zlib.adler32_combine(adler1, adler2, len2) * @@ -332,6 +333,9 @@ 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 @@ return do_checksum(argc, argv, crc32); } +#ifdef HAVE_CRC32_COMBINE /* * call-seq: Zlib.crc32_combine(crc1, crc2, len2) * @@ -362,6 +367,9 @@ 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. Index: ext/zlib/extconf.rb =================================================================== --- ext/zlib/extconf.rb (revision 26352) +++ ext/zlib/extconf.rb (revision 26353) @@ -56,6 +56,9 @@ $defs.concat(defines.collect{|d|' -D'+d}) + have_func('crc32_combine', 'zlib.h') + have_func('adler32_combine', 'zlib.h') + create_makefile('zlib') end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/