summaryrefslogtreecommitdiffstats
path: root/mmap.c
diff options
context:
space:
mode:
authorguy Decoux <ts@moulon.inra.fr>2009-02-28 20:12:15 +0100
committerguy Decoux <ts@moulon.inra.fr>2009-02-28 20:12:15 +0100
commit74b85a22dbbea2dbb74e0e94c996178814eced59 (patch)
treee6bc07cc8363f6acf8ce040f64ac2d0fe2de7e3f /mmap.c
parentfa598d05504f6dd43e29e0f93a3f25d254ebd7c0 (diff)
downloadmmap-ruby-74b85a22dbbea2dbb74e0e94c996178814eced59.zip
mmap-ruby-74b85a22dbbea2dbb74e0e94c996178814eced59.tar.gz
mmap-0.2.0
Diffstat (limited to 'mmap.c')
-rw-r--r--mmap.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mmap.c b/mmap.c
index df6dade..7846fd4 100644
--- a/mmap.c
+++ b/mmap.c
@@ -312,9 +312,8 @@ mm_i_options(arg, obj)
#if RUBY_VERSION_CODE >= 172
static VALUE
-mm_s_alloc(argc, argv, obj)
- int argc;
- VALUE *argv, obj;
+mm_s_alloc(obj)
+ VALUE obj;
{
VALUE res;
mm_mmap *t_mm;
@@ -1719,7 +1718,11 @@ Init_mmap()
rb_include_module(mm_cMap, rb_mEnumerable);
#if RUBY_VERSION_CODE >= 172
- rb_define_singleton_method(mm_cMap, "allocate", mm_s_alloc, -1);
+#if RUBY_VERSION_CODE >= 180
+ rb_define_alloc_func(mm_cMap, mm_s_alloc);
+#else
+ rb_define_singleton_method(mm_cMap, "allocate", mm_s_alloc, 0);
+#endif
#else
rb_define_singleton_method(mm_cMap, "new", mm_s_new, -1);
#endif