[macruby-changes] [4820] MacRuby/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Sun Oct 24 18:14:32 PDT 2010
Revision: 4820
http://trac.macosforge.org/projects/ruby/changeset/4820
Author: lsansonetti at apple.com
Date: 2010-10-24 18:14:30 -0700 (Sun, 24 Oct 2010)
Log Message:
-----------
remove Leopard hacks since it's not supported anymore
Modified Paths:
--------------
MacRuby/trunk/array.c
MacRuby/trunk/dispatcher.cpp
MacRuby/trunk/gc.c
MacRuby/trunk/gcd.c
MacRuby/trunk/vm.cpp
Modified: MacRuby/trunk/array.c
===================================================================
--- MacRuby/trunk/array.c 2010-10-25 00:14:59 UTC (rev 4819)
+++ MacRuby/trunk/array.c 2010-10-25 01:14:30 UTC (rev 4820)
@@ -3609,24 +3609,6 @@
rary_push((VALUE)rcv, OC2RB(obj));
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-// This is to work around a bug where CF will try to call an non-existing
-// method.
-static CFIndex
-imp_rary_cfindexOfObjectInRange(void *rcv, SEL sel, void *obj, CFRange range)
-{
- assert(range.location + range.length <= RARY(rcv)->len);
- VALUE item = OC2RB(obj);
- for (size_t i = range.location; i < range.location + range.length; i++) {
- VALUE item2 = rary_elt((VALUE)rcv, i);
- if (rb_equal_fast(item, item2) == Qtrue) {
- return i;
- }
- }
- return -1;
-}
-#endif
-
bool
rb_objc_ary_is_pure(VALUE ary)
{
@@ -3751,14 +3733,4 @@
(IMP)imp_rary_replaceObjectAtIndexWithObject);
rb_objc_install_method2((Class)rb_cRubyArray, "addObject:",
(IMP)imp_rary_addObject);
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- rb_objc_install_method2((Class)rb_cRubyArray, "_cfindexOfObject:range:",
- (IMP)imp_rary_cfindexOfObjectInRange);
- Method m = class_getInstanceMethod((Class)rb_cRubyArray,
- sel_registerName("_cfindexOfObject:range:"));
- class_addMethod((Class)rb_cRubyArray,
- sel_registerName("_cfindexOfObject:inRange:"),
- method_getImplementation(m), method_getTypeEncoding(m));
-#endif
}
Modified: MacRuby/trunk/dispatcher.cpp
===================================================================
--- MacRuby/trunk/dispatcher.cpp 2010-10-25 00:14:59 UTC (rev 4819)
+++ MacRuby/trunk/dispatcher.cpp 2010-10-25 01:14:30 UTC (rev 4820)
@@ -1487,11 +1487,6 @@
extern IMP basic_respond_to_imp; // vm_method.c
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-// The function is available on Leopard but it's not declared.
-extern "C" id _objc_msgForward(id receiver, SEL sel, ...);
-#endif
-
bool
RoxorCore::respond_to(VALUE obj, VALUE klass, SEL sel, bool priv,
bool check_override)
Modified: MacRuby/trunk/gc.c
===================================================================
--- MacRuby/trunk/gc.c 2010-10-25 00:14:59 UTC (rev 4819)
+++ MacRuby/trunk/gc.c 2010-10-25 01:14:30 UTC (rev 4820)
@@ -161,25 +161,10 @@
if (size == 0) {
size = 1;
}
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
- size_t old_size = malloc_size(ptr);
- if (old_size >= size) {
- return ptr;
- }
- void *mem = ruby_xmalloc(size);
- if (mem == NULL) {
- rb_memerror();
- }
- auto_zone_write_barrier_memmove(__auto_zone, mem, ptr, old_size);
- xfree(ptr);
-#else
void *mem = malloc_zone_realloc(__auto_zone, ptr, size);
if (mem == NULL) {
rb_memerror();
}
-#endif
-
return mem;
}
Modified: MacRuby/trunk/gcd.c
===================================================================
--- MacRuby/trunk/gcd.c 2010-10-25 00:14:59 UTC (rev 4819)
+++ MacRuby/trunk/gcd.c 2010-10-25 01:14:30 UTC (rev 4820)
@@ -8,8 +8,6 @@
#include "ruby/macruby.h"
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
-
#define GCD_BLOCKS_COPY_DVARS 1
#include <dispatch/dispatch.h>
@@ -1362,19 +1360,3 @@
selClose = sel_registerName("close");
assert(selClose != NULL);
}
-
-#else
-
-void
-Init_PreGCD(void)
-{
- // Do nothing...
-}
-
-void
-Init_Dispatch(void)
-{
- // Do nothing...
-}
-
-#endif
Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp 2010-10-25 00:14:59 UTC (rev 4819)
+++ MacRuby/trunk/vm.cpp 2010-10-25 01:14:30 UTC (rev 4820)
@@ -612,7 +612,6 @@
{
assert(func->use_empty());
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
RoxorCoreLock lock;
// Remove from cache.
@@ -640,7 +639,6 @@
// Delete IR.
func->eraseFromParent();
-#endif
}
#endif
@@ -3335,7 +3333,7 @@
b->arity.real = 1;
b->flags = VM_BLOCK_PROC;
b->imp = (IMP)rb_vm_iterate_block;
- GC_WB(&b->dvars[0], (VALUE *)bl_proc);
+ b->dvars[0] =(VALUE *)bl_proc;
GC_WB(&b->dvars[1], (VALUE *)data2);
RoxorVM *vm = GET_VM();
@@ -3354,11 +3352,6 @@
return (*it_proc)(data1);
}
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
-// the function is available on Leopard but it's not declared
-extern "C" id _objc_msgForward(id receiver, SEL sel, ...);
-#endif
-
#if 0
static inline IMP
class_respond_to(Class klass, SEL sel)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101024/00c14670/attachment-0001.html>
More information about the macruby-changes
mailing list