From 74b85a22dbbea2dbb74e0e94c996178814eced59 Mon Sep 17 00:00:00 2001 From: guy Decoux Date: Sat, 28 Feb 2009 20:12:15 +0100 Subject: mmap-0.2.0 --- Changes | 4 ++++ extconf.rb | 12 +++++++++++- mmap.c | 11 +++++++---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Changes b/Changes index aac511c..e1325d2 100644 --- a/Changes +++ b/Changes @@ -49,3 +49,7 @@ * String#slice! was modified in 1.6.8 * added ::new(IO) + +--- 0.2.0 + +* adapted for 1.8.0 diff --git a/extconf.rb b/extconf.rb index 1e8f37f..78d9bd8 100644 --- a/extconf.rb +++ b/extconf.rb @@ -1,5 +1,15 @@ require "mkmf" + +$stat_lib = if CONFIG.key?("LIBRUBYARG_STATIC") + $LDFLAGS += " -L#{CONFIG['libdir']}" + CONFIG["LIBRUBYARG_STATIC"] + else + "-lruby" + end +$static ||= nil + create_makefile "mmap" + begin make = open("Makefile", "a") make.puts "\ntest: $(DLLIB)" @@ -12,7 +22,7 @@ begin unknown: $(DLLIB) \t@echo "main() {}" > /tmp/a.c -\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(DLDFLAGS) -lruby #{CONFIG["LIBS"]} $(LIBS) $(LOCAL_LIBS) +\t$(CC) -static /tmp/a.c $(OBJS) $(CPPFLAGS) $(DLDFLAGS) #$stat_lib #{CONFIG["LIBS"]} $(LIBS) $(LOCAL_LIBS) \t@-rm /tmp/a.c a.out %.html: %.rd 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 -- cgit v1.1-2-g2b99