[macruby-changes] [449] MacRuby/branches/lrz_unstable

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 16 01:35:52 PDT 2008


Revision: 449
          http://trac.macosforge.org/projects/ruby/changeset/449
Author:   lsansonetti at apple.com
Date:     2008-08-16 01:35:51 -0700 (Sat, 16 Aug 2008)
Log Message:
-----------
more cleanup

Modified Paths:
--------------
    MacRuby/branches/lrz_unstable/class.c
    MacRuby/branches/lrz_unstable/encoding.c
    MacRuby/branches/lrz_unstable/object.c

Modified: MacRuby/branches/lrz_unstable/class.c
===================================================================
--- MacRuby/branches/lrz_unstable/class.c	2008-08-16 02:25:22 UTC (rev 448)
+++ MacRuby/branches/lrz_unstable/class.c	2008-08-16 08:35:51 UTC (rev 449)
@@ -1,14 +1,14 @@
-/**********************************************************************
+/* 
+ * MacRuby implementation of Ruby 1.9's class.c.
+ *
+ * This file is covered by the Ruby license. See COPYING for more details.
+ * 
+ * Copyright (C) 2007-2008, Apple Inc. All rights reserved.
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ */
 
-  class.c -
-
-  $Author: akr $
-  created at: Tue Aug 10 15:05:44 JST 1993
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #include "ruby/ruby.h"
 #include "ruby/signal.h"
 #include "ruby/node.h"
@@ -22,8 +22,6 @@
 #define VISI(x) ((x)&NOEX_MASK)
 #define VISI_CHECK(x,f) (VISI(x) == (f))
 
-#if WITH_OBJC
-
 void rb_objc_install_array_primitives(Class);
 void rb_objc_install_hash_primitives(Class);
 void rb_objc_install_string_primitives(Class);
@@ -136,43 +134,10 @@
     return klass;
 }
 
-#else /* WITH_OBJC */
-
-static VALUE
-class_init(VALUE obj)
-{
-    GC_WB(&RCLASS(obj)->ptr, ALLOC(rb_classext_t));
-    RCLASS_IV_TBL(obj) = 0;
-    RCLASS_M_TBL(obj) = 0;
-    RCLASS_SUPER(obj) = 0;
-    RCLASS_IV_INDEX_TBL(obj) = 0;
-    return obj;
-}
-
-#endif
-
-#if !WITH_OBJC
-static VALUE
-class_alloc(VALUE flags, VALUE klass)
-{
-    NEWOBJ(obj, struct RClass);
-    OBJSETUP(obj, klass, flags);
-    return class_init((VALUE)obj);
-}
-#endif
-
 VALUE
 rb_class_boot(VALUE super)
 {
-#if WITH_OBJC
     VALUE klass = rb_objc_create_class(NULL, super);
-#else
-    VALUE klass = class_alloc(T_CLASS, rb_cClass);
-
-    RCLASS_SUPER(klass) = super;
-    RCLASS_M_TBL(klass) = st_init_numtable();
-    OBJ_INFECT(klass, super);
-#endif
     return (VALUE)klass;
 }
 
@@ -199,42 +164,11 @@
     return rb_class_boot(super);
 }
 
-#if !WITH_OBJC
-struct clone_method_data {
-    st_table *tbl;
-    VALUE klass;
-};
-
-static int
-clone_method(ID mid, NODE *body, struct clone_method_data *data)
-{
-    if (body == 0) {
-	st_insert(data->tbl, mid, 0);
-    }
-    else {
-	st_insert(data->tbl, mid,
-		  (st_data_t)
-		  NEW_FBODY(
-		      NEW_METHOD(body->nd_body->nd_body,
-				 data->klass, /* TODO */
-				 body->nd_body->nd_noex),
-		      0));
-    }
-    return ST_CONTINUE;
-}
-#endif
-
 /* :nodoc: */
 VALUE
 rb_mod_init_copy(VALUE clone, VALUE orig)
 {
     rb_obj_init_copy(clone, orig);
-#if !WITH_OBJC
-    if (!RCLASS_SINGLETON(CLASS_OF(clone))) {
-	RBASIC(clone)->klass = rb_singleton_class_clone(orig);
-    }
-#endif
-#if WITH_OBJC
     {
 	VALUE super;
 	int version_flag;
@@ -257,9 +191,6 @@
 
 	class_setVersion((Class)clone, version_flag);
     }
-#else
-    RCLASS_SUPER(clone) = RCLASS_SUPER(orig);
-#endif
 #if 0 // TODO
     if (RCLASS_IV_TBL(orig)) {
 	ID id;
@@ -287,18 +218,11 @@
 VALUE
 rb_class_init_copy(VALUE clone, VALUE orig)
 {
-#if !WITH_OBJC
-    if (RCLASS_SUPER(clone) != 0) {
-	rb_raise(rb_eTypeError, "already initialized class");
-    }
-#endif
     if (RCLASS_SINGLETON(orig)) {
 	rb_raise(rb_eTypeError, "can't copy singleton class");
     }
     clone =  rb_mod_init_copy(clone, orig);
-#if WITH_OBJC 
     rb_objc_install_primitives((Class)clone, (Class)orig);
-#endif
     return clone;
 }
 
@@ -306,7 +230,6 @@
 rb_singleton_class_clone(VALUE obj)
 {
     VALUE klass = RBASIC(obj)->klass;
-#if WITH_OBJC
     if (!RCLASS_SINGLETON(klass)) {
 	return klass;
     }
@@ -351,65 +274,23 @@
 
 	return clone;
     }
-#else
-    if (!FL_TEST(klass, FL_SINGLETON))
-	return klass;
-    else {
-	struct clone_method_data data;
-	/* copy singleton(unnamed) class */
-        VALUE clone = class_alloc(RBASIC(klass)->flags, 0);
-
-	if (BUILTIN_TYPE(obj) == T_CLASS) {
-	    RBASIC(clone)->klass = (VALUE)clone;
-	}
-	else {
-	    RBASIC(clone)->klass = rb_singleton_class_clone(klass);
-	}
-
-	RCLASS_SUPER(clone) = RCLASS_SUPER(klass);
-	if (RCLASS_IV_TBL(klass)) {
-	    GC_WB(&RCLASS_IV_TBL(clone), st_copy(RCLASS_IV_TBL(klass)));
-	}
-	GC_WB(&RCLASS_M_TBL(clone), st_init_numtable());
-	data.tbl = RCLASS_M_TBL(clone);
-	data.klass = (VALUE)clone;
-	st_foreach(RCLASS_M_TBL(klass), clone_method,
-	  (st_data_t)&data);
-	rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);
-	FL_SET(clone, FL_SINGLETON);
-	return (VALUE)clone;
-    }
-#endif
 }
 
 void
 rb_singleton_class_attached(VALUE klass, VALUE obj)
 {
-#if WITH_OBJC
     if (RCLASS_SINGLETON(klass)) {
 	static ID attachedId = 0;
 	if (attachedId == 0)
 	    attachedId = rb_intern("__attached__");
 	rb_ivar_set(klass, attachedId, obj);
     }
-#else
-    if (FL_TEST(klass, FL_SINGLETON)) {
-	if (!RCLASS_IV_TBL(klass)) {
-	    GC_WB(&RCLASS_IV_TBL(klass), st_init_numtable());
-	}
-	st_insert(RCLASS_IV_TBL(klass), rb_intern("__attached__"), obj);
-    }
-#endif
 }
 
 VALUE
 rb_make_metaclass(VALUE obj, VALUE super)
 {
-#if WITH_OBJC
     if (TYPE(obj) == T_CLASS && RCLASS_SINGLETON(obj)) {
-#else
-    if (BUILTIN_TYPE(obj) == T_CLASS && FL_TEST(obj, FL_SINGLETON)) {
-#endif
 	RBASIC(obj)->klass = rb_cClass;
 	return rb_cClass;
     }
@@ -418,14 +299,10 @@
 
 	klass = rb_class_boot(super);
 	RBASIC(obj)->klass = klass;
-#if WITH_OBJC
 	if (super == rb_cNSObject) {
 	    RCLASS_VERSION(klass) ^= RCLASS_IS_OBJECT_SUBCLASS;
 	}
 	RCLASS_SET_VERSION_FLAG(klass, RCLASS_IS_SINGLETON);
-#else
-	FL_SET(klass, FL_SINGLETON);
-#endif
 
 	rb_singleton_class_attached(klass, obj);
 
@@ -439,12 +316,7 @@
     VALUE klass;
 
     if (!super) super = rb_cObject;
-#if WITH_OBJC
     klass = rb_objc_create_class(rb_id2name(id), super);
-#else
-    klass = rb_class_new(super);
-    rb_make_metaclass(klass, RBASIC(super)->klass);
-#endif
 
     return klass;
 }
@@ -517,13 +389,8 @@
 VALUE
 rb_module_new(void)
 {
-#if WITH_OBJC
     VALUE mdl = rb_objc_alloc_class(NULL, 0, T_MODULE, rb_cModule);
     objc_registerClassPair((Class)mdl);
-#else
-    VALUE mdl = class_alloc(T_MODULE, rb_cModule);
-    RCLASS_M_TBL(mdl) = st_init_numtable();
-#endif
 
     return (VALUE)mdl;
 }
@@ -533,13 +400,8 @@
 {
     VALUE mdl;
 
-#if WITH_OBJC
     mdl = rb_objc_alloc_class(rb_id2name(id), 0, T_MODULE, rb_cModule);
     objc_registerClassPair((Class)mdl);
-#else
-    mdl = rb_module_new();
-    rb_name_class(mdl, id);
-#endif
 
     return mdl;
 }
@@ -585,42 +447,9 @@
     return module;
 }
 
-#if !WITH_OBJC
-static VALUE
-include_class_new(VALUE module, VALUE super)
-{
-    VALUE klass = class_alloc(T_ICLASS, rb_cClass);
-
-    if (BUILTIN_TYPE(module) == T_ICLASS) {
-	module = RBASIC(module)->klass;
-    }
-#if !WITH_OBJC
-    if (!RCLASS_IV_TBL(module)) {
-	GC_WB(&RCLASS_IV_TBL(module), st_init_numtable());
-    }
-    RCLASS_IV_TBL(klass) = RCLASS_IV_TBL(module);
-    RCLASS_M_TBL(klass) = RCLASS_M_TBL(module);
-    RCLASS_SUPER(klass) = super;
-#else
-    class_setSuperclass((Class)klass, (Class)super);
-#endif
-    if (TYPE(module) == T_ICLASS) {
-	RBASIC(klass)->klass = RBASIC(module)->klass;
-    }
-    else {
-	RBASIC(klass)->klass = module;
-    }
-    OBJ_INFECT(klass, module);
-    OBJ_INFECT(klass, super);
-
-    return (VALUE)klass;
-}
-#endif
-
 void
 rb_include_module(VALUE klass, VALUE module)
 {
-#if WITH_OBJC
     Method *methods;
     unsigned int i, methods_count;
     VALUE ary;
@@ -669,49 +498,6 @@
 	}
 	free(methods);
     }
-#else
-    VALUE p, c;
-    int changed = 0;
-
-    rb_frozen_class_p(klass);
-    if (!OBJ_TAINTED(klass)) {
-	rb_secure(4);
-    }
-    
-    if (TYPE(module) != T_MODULE) {
-	Check_Type(module, T_MODULE);
-    }
-
-    OBJ_INFECT(klass, module);
-    c = klass;
-    while (module) {
-       int superclass_seen = Qfalse;
-
-	if (RCLASS_M_TBL(klass) == RCLASS_M_TBL(module))
-	    rb_raise(rb_eArgError, "cyclic include detected");
-	/* ignore if the module included already in superclasses */
-	for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
-	    switch (BUILTIN_TYPE(p)) {
-		case T_ICLASS:
-		    if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
-			if (!superclass_seen) {
-			    c = p;  /* move insertion point */
-			}
-			goto skip;
-		    }
-		    break;
-		case T_CLASS:
-		    superclass_seen = Qtrue;
-		    break;
-	    }
-	}
-	c = RCLASS_SUPER(c) = include_class_new(module, RCLASS_SUPER(c));
-	changed = 1;
-      skip:
-	module = RCLASS_SUPER(module);
-    }
-    if (changed) rb_clear_cache();
-#endif
 }
 
 /*
@@ -750,19 +536,11 @@
 {
     VALUE p, ary = rb_ary_new();
 
-#if WITH_OBJC
     for (p = mod; p; p = RCLASS_SUPER(p)) {
 	rb_mod_included_modules_nosuper(p, ary);
 	if (RCLASS_MODULE(p))
 	    break;
     }
-#else
-    for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
-	if (BUILTIN_TYPE(p) == T_ICLASS) {
-	    rb_ary_push(ary, RBASIC(p)->klass);
-	}
-    }
-#endif
     return ary;
 }
 
@@ -788,19 +566,7 @@
 VALUE
 rb_mod_include_p(VALUE mod, VALUE mod2)
 {
-#if WITH_OBJC
     return rb_ary_includes(rb_mod_included_modules(mod), mod2);
-#else
-    VALUE p;
-
-    Check_Type(mod2, T_MODULE);
-    for (p = RCLASS_SUPER(mod); p; p = RCLASS_SUPER(p)) {
-	if (BUILTIN_TYPE(p) == T_ICLASS) {
-	    if (RBASIC(p)->klass == mod2) return Qtrue;
-	}
-    }
-    return Qfalse;
-#endif
 }
 
 /*
@@ -826,25 +592,12 @@
 {
     VALUE p, ary = rb_ary_new();
    
-#if WITH_OBJC
     for (p = mod; p; p = RCLASS_SUPER(p)) {
 	rb_ary_push(ary, p);
 	rb_mod_included_modules_nosuper(p, ary);
 	if (RCLASS_MODULE(p))
 	    break;
     }
-#else
-    for (p = mod; p; p = RCLASS_SUPER(p)) {
-	if (RCLASS_SINGLETON(p))
-	    continue;
-	if (BUILTIN_TYPE(p) == T_ICLASS) {
-	    rb_ary_push(ary, RBASIC(p)->klass);
-	}
-	else {
-	    rb_ary_push(ary, p);
-	}
-    }
-#endif
     return ary;
 }
 
@@ -893,29 +646,6 @@
     return ins_methods_push(name, type, ary, NOEX_PUBLIC);
 }
 
-#if !WITH_OBJC
-static int
-method_entry(ID key, NODE *body, st_table *list)
-{
-    long type;
-
-    if (key == ID_ALLOCATOR) {
-	return ST_CONTINUE;
-    }
-    
-    if (!st_lookup(list, key, 0)) {
-	if (body ==0 || !body->nd_body->nd_body) {
-	    type = -1; /* none */
-	}
-	else {
-	    type = VISI(body->nd_body->nd_noex);
-	}
-	st_add_direct(list, key, type);
-    }
-    return ST_CONTINUE;
-}
-#endif
-
 static void
 rb_objc_push_methods(VALUE ary, VALUE mod)
 {
@@ -979,7 +709,6 @@
 static VALUE
 class_instance_method_list(int argc, VALUE *argv, VALUE mod, int (*func) (ID, long, VALUE))
 {
-#if WITH_OBJC
     VALUE ary;
     bool recur;
 
@@ -1000,33 +729,7 @@
 	   break;	   
 	mod = (VALUE)class_getSuperclass((Class)mod); 
     } 
-#else
-    VALUE ary;
-    int recur;
-    st_table *list;
-    VALUE mod_orig = mod;
 
-    if (argc == 0) {
-	recur = Qtrue;
-    }
-    else {
-	VALUE r;
-	rb_scan_args(argc, argv, "01", &r);
-	recur = RTEST(r);
-    }
-
-    list = st_init_numtable();
-    for (; mod; mod = RCLASS_SUPER(mod)) {
-	st_foreach(RCLASS_M_TBL(mod), method_entry, (st_data_t)list);
-	if (BUILTIN_TYPE(mod) == T_ICLASS) continue;
-	if (FL_TEST(mod, FL_SINGLETON)) continue;
-	if (!recur) break;
-    }
-    ary = rb_ary_new();
-    st_foreach(list, func, ary);
-    st_free_table(list);
-#endif
-
     return ary;
 }
 
@@ -1151,7 +854,6 @@
 VALUE
 rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
 {
-#if WITH_OBJC
     VALUE recur, klass, ary;
 
     if (argc == 0) {
@@ -1170,33 +872,7 @@
 	klass = RCLASS_SUPER(klass);
     }
     while (recur == Qtrue && klass != 0);
-#else
-    VALUE recur, ary, klass;
-    st_table *list;
 
-    if (argc == 0) {
-	recur = Qtrue;
-    }
-    else {
-	rb_scan_args(argc, argv, "01", &recur);
-    }
-    klass = CLASS_OF(obj);
-    list = st_init_numtable();
-    if (klass && FL_TEST(klass, FL_SINGLETON)) {
-	st_foreach(RCLASS_M_TBL(klass), method_entry, (st_data_t)list);
-	klass = RCLASS_SUPER(klass);
-    }
-    if (RTEST(recur)) {
-	while (klass && (FL_TEST(klass, FL_SINGLETON) || TYPE(klass) == T_ICLASS)) {
-	    st_foreach(RCLASS_M_TBL(klass), method_entry, (st_data_t)list);
-	    klass = RCLASS_SUPER(klass);
-	}
-    }
-    ary = rb_ary_new();
-    st_foreach(list, ins_methods_i, ary);
-    st_free_table(list);
-#endif
-
     return ary;
 }
 
@@ -1257,7 +933,6 @@
 	klass = RBASIC(obj)->klass;
     }
     else {
-#if WITH_OBJC
 	switch (TYPE(obj)) {
 	    case T_CLASS:
 	    case T_MODULE:
@@ -1267,7 +942,6 @@
 		klass = rb_make_metaclass(obj, RBASIC(obj)->klass);
 		break;
 	}
-#endif
     }
 #if 0
     if (OBJ_TAINTED(obj)) {
@@ -1356,7 +1030,7 @@
 	p++;
     }
 
-    if(*p == '*') {
+    if (*p == '*') {
       rest_arg:
 	var = va_arg(vargs, VALUE*);
 	if (argc > i) {

Modified: MacRuby/branches/lrz_unstable/encoding.c
===================================================================
--- MacRuby/branches/lrz_unstable/encoding.c	2008-08-16 02:25:22 UTC (rev 448)
+++ MacRuby/branches/lrz_unstable/encoding.c	2008-08-16 08:35:51 UTC (rev 449)
@@ -1,14 +1,14 @@
-/**********************************************************************
+/* 
+ * MacRuby implementation of Ruby 1.9's encoding.c.
+ *
+ * This file is covered by the Ruby license. See COPYING for more details.
+ * 
+ * Copyright (C) 2007-2008, Apple Inc. All rights reserved.
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ */
 
-  encoding.c -
-
-  $Author: nobu $
-  created at: Thu May 24 17:23:27 JST 2007
-
-  Copyright (C) 2007 Yukihiro Matsumoto
-
-**********************************************************************/
-
 #include "ruby/ruby.h"
 #include "ruby/encoding.h"
 #include "regenc.h"
@@ -20,8 +20,6 @@
 static ID id_encoding, id_base_encoding;
 VALUE rb_cEncoding;
 
-#if WITH_OBJC
-
 static CFMutableDictionaryRef __encodings = NULL;
 
 static VALUE
@@ -115,307 +113,6 @@
     return rb_enc_to_enc_ptr(v);
 }
 
-#else
-
-struct rb_encoding_entry {
-    const char *name;
-    rb_encoding *enc;
-};
-
-static struct {
-    struct rb_encoding_entry *list;
-    int count;
-    int size;
-    st_table *names;
-} enc_table;
-
-void rb_enc_init(void);
-
-#define ENCODING_COUNT ENCINDEX_BUILTIN_MAX
-
-#define enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc))
-
-#define ENC_UNINITIALIZED (&rb_cEncoding)
-#define enc_initialized_p(enc) ((enc)->auxiliary_data != &rb_cEncoding)
-#define ENC_FROM_ENCODING(enc) ((VALUE)(enc)->auxiliary_data)
-
-#define ENC_DUMMY_FLAG FL_USER2
-#define ENC_DUMMY_P(enc) (RBASIC(enc)->flags & ENC_DUMMY_FLAG)
-#define ENC_SET_DUMMY(enc) (RBASIC(enc)->flags |= ENC_DUMMY_FLAG)
-
-static int load_encoding(const char *name);
-static VALUE enc_base_encoding(VALUE self);
-
-static void
-enc_mark(void *ptr)
-{
-}
-
-static VALUE
-enc_new(rb_encoding *encoding)
-{
-    VALUE enc = Data_Wrap_Struct(rb_cEncoding, enc_mark, 0, encoding);
-    encoding->auxiliary_data = (void *)enc;
-    return enc;
-}
-
-VALUE
-rb_enc_from_encoding(rb_encoding *encoding)
-{
-    if (!encoding) return Qnil;
-    if (enc_initialized_p(encoding))
-	return ENC_FROM_ENCODING(encoding);
-    return enc_new(encoding);
-}
-
-static int
-enc_check_encoding(VALUE obj)
-{
-    int index;
-    rb_encoding *enc;
-
-    if (SPECIAL_CONST_P(obj) || BUILTIN_TYPE(obj) != T_DATA ||
-	RDATA(obj)->dmark != enc_mark) {
-	return -1;
-    }
-    enc = (rb_encoding*)RDATA(obj)->data;
-    index = rb_enc_to_index(enc);
-    if (rb_enc_from_index(index) != enc)
-	return -1;
-    if (enc_autoload_p(enc)) {
-	index = rb_enc_find_index(enc->name);
-    }
-    return index;
-}
-
-int
-rb_to_encoding_index(VALUE enc)
-{
-    int idx;
-
-    idx = enc_check_encoding(enc);
-    if (idx >= 0) {
-	return idx;
-    }
-    else if (NIL_P(enc = rb_check_string_type(enc))) {
-	return -1;
-    }
-    else {
-	return rb_enc_find_index(StringValueCStr(enc));
-    }
-}
-
-rb_encoding *
-rb_to_encoding(VALUE enc)
-{
-    int idx;
-
-    idx = enc_check_encoding(enc);
-    if (idx >= 0) return RDATA(enc)->data;
-    if ((idx = rb_enc_find_index(StringValueCStr(enc))) < 0) {
-	rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_BYTEPTR(enc));
-    }
-    return rb_enc_from_index(idx);
-}
-
-void
-rb_gc_mark_encodings(void)
-{
-    int i;
-    for (i = 0; i < enc_table.count; ++i) {
-	rb_encoding *enc = enc_table.list[i].enc;
-	if (enc && enc_initialized_p(enc)) {
-	    rb_gc_mark(ENC_FROM_ENCODING(enc));
-	}
-    }
-}
-
-static int
-enc_table_expand(int newsize)
-{
-    struct rb_encoding_entry *ent;
-    int count = newsize;
-
-    if (enc_table.size >= newsize) return newsize;
-    newsize = (newsize + 7) / 8 * 8;
-    ent = realloc(enc_table.list, sizeof(*enc_table.list) * newsize);
-    if (!ent) return -1;
-    memset(ent + enc_table.size, 0, sizeof(*ent)*(newsize - enc_table.size));
-    enc_table.list = ent;
-    enc_table.size = newsize;
-    return count;
-}
-
-static int
-enc_register_at(int index, const char *name, rb_encoding *encoding)
-{
-    struct rb_encoding_entry *ent = &enc_table.list[index];
-    void *obj = ENC_UNINITIALIZED;
-
-    if (!ent->name) {
-	ent->name = name = strdup(name);
-    }
-    else if (STRCASECMP(name, ent->name)) {
-	return -1;
-    }
-    if (!ent->enc) {
-	ent->enc = malloc(sizeof(rb_encoding));
-    }
-    else {
-	obj = ent->enc->auxiliary_data;
-    }
-    if (encoding) {
-	*ent->enc = *encoding;
-    }
-    else {
-	memset(ent->enc, 0, sizeof(*ent->enc));
-    }
-    encoding = ent->enc;
-    encoding->name = name;
-    encoding->ruby_encoding_index = index;
-    st_insert(enc_table.names, (st_data_t)name, (st_data_t)index);
-    if (obj != ENC_UNINITIALIZED) {
-	encoding->auxiliary_data = obj;
-    }
-    else if (rb_cEncoding) {
-	/* initialize encoding data */
-	enc_new(encoding);
-    }
-    else {
-	encoding->auxiliary_data = ENC_UNINITIALIZED;
-    }
-    return index;
-}
-
-static int
-enc_register(const char *name, rb_encoding *encoding)
-{
-    int index = enc_table.count;
-
-    if ((index = enc_table_expand(index + 1)) < 0) return -1;
-    enc_table.count = index;
-    return enc_register_at(index - 1, name, encoding);
-}
-
-static void set_encoding_const(const char *, rb_encoding *);
-int rb_enc_registered(const char *name);
-
-int
-rb_enc_register(const char *name, rb_encoding *encoding)
-{
-    int index = rb_enc_registered(name);
-
-    if (index >= 0) {
-	rb_encoding *oldenc = rb_enc_from_index(index);
-	if (STRCASECMP(name, rb_enc_name(oldenc))) {
-	    index = enc_register(name, encoding);
-	}
-	else if (!enc_autoload_p(oldenc) ||
-		 (enc_initialized_p(oldenc) &&
-		  !ENC_DUMMY_P(ENC_FROM_ENCODING(oldenc)))) {
-	    enc_register_at(index, name, encoding);
-	}
-	else {
-	    rb_raise(rb_eArgError, "encoding %s is already registered", name);
-	}
-    }
-    else {
-	index = enc_register(name, encoding);
-	set_encoding_const(name, rb_enc_from_index(index));
-    }
-    return index;
-}
-
-void
-rb_encdb_declare(const char *name)
-{
-    int idx = rb_enc_registered(name);
-    if (idx < 0) {
-	idx = enc_register(name, 0);
-    }
-    set_encoding_const(name, rb_enc_from_index(idx));
-}
-
-static void
-enc_check_duplication(const char *name)
-{
-    if (rb_enc_registered(name) >= 0) {
-	rb_raise(rb_eArgError, "encoding %s is already registered", name);
-    }
-}
-
-static VALUE
-set_base_encoding(int index, rb_encoding *base)
-{
-    VALUE enc = rb_enc_from_encoding(enc_table.list[index].enc);
-
-    rb_ivar_set(enc, id_base_encoding, rb_enc_from_encoding(base));
-    if (rb_enc_dummy_p(base)) ENC_SET_DUMMY(enc);
-    return enc;
-}
-
-int
-rb_enc_replicate(const char *name, rb_encoding *encoding)
-{
-    int idx;
-
-    enc_check_duplication(name);
-    idx = enc_register(name, encoding);
-    set_base_encoding(idx, encoding);
-    set_encoding_const(name, rb_enc_from_index(idx));
-    return idx;
-}
-
-static int
-enc_replicate(int idx, const char *name, rb_encoding *origenc)
-{
-    if (idx < 0) {
-	idx = enc_register(name, origenc);
-    }
-    else {
-	idx = enc_register_at(idx, name, origenc);
-    }
-    if (idx >= 0) {
-	set_base_encoding(idx, origenc);
-	set_encoding_const(name, rb_enc_from_index(idx));
-    }
-    return idx;
-}
-
-int
-rb_encdb_replicate(const char *name, const char *orig)
-{
-    int origidx = rb_enc_registered(orig);
-    int idx = rb_enc_registered(name);
-
-    if (origidx < 0) {
-	origidx = enc_register(orig, 0);
-    }
-    return enc_replicate(idx, name, rb_enc_from_index(origidx));
-}
-
-int
-rb_define_dummy_encoding(const char *name)
-{
-    int index = rb_enc_replicate(name, rb_ascii8bit_encoding());
-    VALUE enc = rb_enc_from_encoding(enc_table.list[index].enc);
-
-    ENC_SET_DUMMY(enc);
-    return index;
-}
-
-int
-rb_encdb_dummy(const char *name)
-{
-    int index = enc_replicate(rb_enc_registered(name), name,
-			      rb_ascii8bit_encoding());
-    VALUE enc = rb_enc_from_encoding(enc_table.list[index].enc);
-
-    ENC_SET_DUMMY(enc);
-    return index;
-}
-#endif // WITH_OBJC
-
 /*
  * call-seq:
  *   enc.dummy? => true or false
@@ -435,208 +132,6 @@
     return rb_enc_dummy_p(rb_to_encoding(enc)) ? Qtrue : Qfalse;
 }
 
-#if !WITH_OBJC
-static int
-enc_alias(const char *alias, int idx)
-{
-    alias = strdup(alias);
-    st_insert(enc_table.names, (st_data_t)alias, (st_data_t)idx);
-    set_encoding_const(alias, rb_enc_from_index(idx));
-    return idx;
-}
-
-int
-rb_enc_alias(const char *alias, const char *orig)
-{
-    int idx;
-
-    enc_check_duplication(alias);
-    if (!enc_table.list) {
-	rb_enc_init();
-    }
-    if ((idx = rb_enc_find_index(orig)) < 0) {
-	return -1;
-    }
-    return enc_alias(alias, idx);
-}
-
-int
-rb_encdb_alias(const char *alias, const char *orig)
-{
-    int idx = rb_enc_registered(orig);
-
-    if (idx < 0) {
-	idx = enc_register(orig, 0);
-    }
-    return enc_alias(alias, idx);
-}
-
-enum {
-    ENCINDEX_ASCII,
-    ENCINDEX_UTF_8,
-    ENCINDEX_US_ASCII,
-    ENCINDEX_BUILTIN_MAX
-};
-
-extern rb_encoding OnigEncodingUTF_8;
-extern rb_encoding OnigEncodingUS_ASCII;
-
-void
-rb_enc_init(void)
-{
-    enc_table_expand(ENCODING_COUNT + 1);
-    if (!enc_table.names) {
-	enc_table.names = st_init_strcasetable();
-	GC_ROOT(&enc_table.names);
-    }
-#define ENC_REGISTER(enc) enc_register_at(ENCINDEX_##enc, rb_enc_name(&OnigEncoding##enc), &OnigEncoding##enc)
-    ENC_REGISTER(ASCII);
-    ENC_REGISTER(UTF_8);
-    ENC_REGISTER(US_ASCII);
-#undef ENC_REGISTER
-    enc_table.count = ENCINDEX_BUILTIN_MAX;
-}
-
-rb_encoding *
-rb_enc_from_index(int index)
-{
-    if (!enc_table.list) {
-	rb_enc_init();
-    }
-    if (index < 0 || enc_table.count <= index) {
-	return 0;
-    }
-    return enc_table.list[index].enc;
-}
-
-int
-rb_enc_registered(const char *name)
-{
-    st_data_t idx = 0;
-
-    if (!name) return -1;
-    if (!enc_table.list) return -1;
-    if (st_lookup(enc_table.names, (st_data_t)name, &idx)) {
-	return (int)idx;
-    }
-    return -1;
-}
-
-static VALUE
-require_enc(VALUE enclib)
-{
-    return rb_require_safe(enclib, rb_safe_level());
-}
-
-static int
-load_encoding(const char *name)
-{
-    VALUE enclib = rb_sprintf("enc/%s", name);
-    VALUE verbose = ruby_verbose;
-    VALUE debug = ruby_debug;
-    VALUE loaded;
-    char *s = RSTRING_BYTEPTR(enclib) + 4, *e = RSTRING_END(enclib);
-    int idx;
-
-    while (s < e) {
-	if (!ISALNUM(*s)) *s = '_';
-	else if (ISUPPER(*s)) *s = TOLOWER(*s);
-	++s;
-    }
-    OBJ_FREEZE(enclib);
-    ruby_verbose = Qfalse;
-    ruby_debug = Qfalse;
-    loaded = rb_protect(require_enc, enclib, 0);
-    ruby_verbose = verbose;
-    ruby_debug = debug;
-    rb_set_errinfo(Qnil);
-    if (NIL_P(loaded)) return -1;
-    if ((idx = rb_enc_registered(name)) < 0) return -1;
-    if (enc_autoload_p(enc_table.list[idx].enc)) return -1;
-    return idx;
-}
-
-int
-rb_enc_find_index(const char *name)
-{
-    int i = rb_enc_registered(name), b;
-    rb_encoding *enc;
-    VALUE base;
-
-    if (i < 0) {
-	i = load_encoding(name);
-    }
-    else if (enc_autoload_p(enc = rb_enc_from_index(i))) {
-	if (enc_initialized_p(enc) &&
-	    (base = enc_base_encoding(ENC_FROM_ENCODING(enc)), !NIL_P(base))) {
-	    if ((b = enc_check_encoding(base)) < 0) {
-		goto failed;
-	    }
-	    enc_register_at(i, rb_enc_name(enc), rb_enc_from_index(b));
-	}
-	else {
-	    i = load_encoding(rb_enc_name(enc));
-	    if (i < 0) {
-	      failed:
-		rb_warn("failed to load encoding (%s); use ASCII-8BIT instead",
-			name);
-		return 0;
-	    }
-	}
-    }
-    return i;
-}
-
-rb_encoding *
-rb_enc_find(const char *name)
-{
-    int idx = rb_enc_find_index(name);
-    if (idx < 0) idx = 0;
-    return rb_enc_from_index(idx);
-}
-
-static inline int
-enc_capable(VALUE obj)
-{
-    if (SPECIAL_CONST_P(obj)) return Qfalse;
-    switch (/*BUILTIN_*/TYPE(obj)) {
-      case T_STRING:
-      case T_REGEXP:
-      case T_FILE:
-	return Qtrue;
-      case T_DATA:
-	if (RDATA(obj)->dmark == enc_mark) return Qtrue;
-      default:
-	return Qfalse;
-    }
-}
-
-static void
-enc_check_capable(VALUE x)
-{
-    if (!enc_capable(x)) {
-	const char *etype;
-
-	if (NIL_P(x)) {
-	    etype = "nil";
-	}
-	else if (FIXNUM_P(x)) {
-	    etype = "Fixnum";
-	}
-	else if (SYMBOL_P(x)) {
-	    etype = "Symbol";
-	}
-	else if (rb_special_const_p(x)) {
-	    etype = RSTRING_BYTEPTR(rb_obj_as_string(x));
-	}
-	else {
-	    etype = rb_obj_classname(x);
-	}
-	rb_raise(rb_eTypeError, "wrong argument type %s (not encode capable)", etype);
-    }
-}
-#endif
-
 ID
 rb_id_encoding(void)
 {
@@ -646,150 +141,16 @@
     return id_encoding;
 }
 
-#if !WITH_OBJC
-int
-rb_enc_internal_get_index(VALUE obj)
-{
-    int i;
-
-    i = ENCODING_GET_INLINED(obj);
-    if (i == ENCODING_INLINE_MAX) {
-	VALUE iv;
-
-	iv = rb_ivar_get(obj, rb_id_encoding());
-	i = NUM2INT(iv);
-    }
-    return i;
-}
-
-void
-rb_enc_internal_set_index(VALUE obj, int idx)
-{
-    if (idx < ENCODING_INLINE_MAX) {
-	ENCODING_SET_INLINED(obj, idx);
-	return;
-    }
-    ENCODING_SET_INLINED(obj, ENCODING_INLINE_MAX);
-    rb_ivar_set(obj, rb_id_encoding(), INT2NUM(idx));
-    return;
-}
-
-void
-rb_enc_associate_index(VALUE obj, int idx)
-{
-    enc_check_capable(obj);
-    if (rb_enc_internal_get_index(obj) == idx)
-    	return;
-    if (!ENC_CODERANGE_ASCIIONLY(obj) ||
-	!rb_enc_asciicompat(rb_enc_from_index(idx))) {
-	ENC_CODERANGE_CLEAR(obj);
-    }
-    rb_enc_internal_set_index(obj, idx);
-}
-
-void
-rb_enc_associate(VALUE obj, rb_encoding *enc)
-{
-    rb_enc_associate_index(obj, rb_enc_to_index(enc));
-}
-
-int
-rb_enc_get_index(VALUE obj)
-{
-    if (!enc_capable(obj)) return -1;
-    return rb_enc_internal_get_index(obj);
-}
-
 rb_encoding*
-rb_enc_get(VALUE obj)
-{
-    return rb_enc_from_index(rb_enc_get_index(obj));
-}
-
-rb_encoding*
-rb_enc_check(VALUE str1, VALUE str2)
-{
-    rb_encoding *enc = rb_enc_compatible(str1, str2);
-    if (!enc)
-	rb_raise(rb_eArgError, "character encodings differ: %s and %s",
-		 rb_enc_name(rb_enc_get(str1)),
-		 rb_enc_name(rb_enc_get(str2)));
-    return enc;
-}
-#endif
-
-rb_encoding*
 rb_enc_compatible(VALUE str1, VALUE str2)
 {
-#if WITH_OBJC
     /* TODO */
     rb_encoding *enc = rb_enc_get(str1);
     if (enc == rb_enc_get(str2))
 	return enc;
     return NULL;
-#else
-    int idx1, idx2;
-    rb_encoding *enc1, *enc2;
-
-    idx1 = rb_enc_get_index(str1);
-    idx2 = rb_enc_get_index(str2);
-
-    if (idx1 < 0 || idx2 < 0)
-        return 0;
-
-    if (idx1 == idx2) {
-	return rb_enc_from_index(idx1);
-    }
-    enc1 = rb_enc_from_index(idx1);
-    enc2 = rb_enc_from_index(idx2);
-
-    if (TYPE(str2) == T_STRING && RSTRING_BYTELEN(str2) == 0)
-	return enc1;
-    if (TYPE(str1) == T_STRING && RSTRING_BYTELEN(str1) == 0)
-	return enc2;
-    if (!rb_enc_asciicompat(enc1) || !rb_enc_asciicompat(enc2)) {
-	return 0;
-    }
-
-    if (BUILTIN_TYPE(str1) != T_STRING) {
-	VALUE tmp = str1;
-	int idx0 = idx1;
-	str1 = str2;
-	str2 = tmp;
-	idx1 = idx2;
-	idx2 = idx0;
-    }
-    if (BUILTIN_TYPE(str1) == T_STRING) {
-	int cr1, cr2;
-
-	cr1 = rb_enc_str_coderange(str1);
-	if (BUILTIN_TYPE(str2) == T_STRING) {
-	    cr2 = rb_enc_str_coderange(str2);
-	    if (cr1 != cr2) {
-		/* may need to handle ENC_CODERANGE_BROKEN */
-		if (cr1 == ENC_CODERANGE_7BIT) return enc2;
-		if (cr2 == ENC_CODERANGE_7BIT) return enc1;
-	    }
-	    if (cr2 == ENC_CODERANGE_7BIT) {
-		if (idx1 == 0) return enc2;
-		return enc1;
-	    }
-	}
-	if (cr1 == ENC_CODERANGE_7BIT)
-	    return enc2;
-    }
-    return 0;
-#endif
 }
 
-#if !WITH_OBJC
-void
-rb_enc_copy(VALUE obj1, VALUE obj2)
-{
-    rb_enc_associate_index(obj1, rb_enc_get_index(obj2));
-}
-#endif
-
 /*
  *  call-seq:
  *     obj.encoding   => encoding
@@ -807,90 +168,6 @@
     return rb_enc_from_encoding(enc);
 }
 
-#if !WITH_OBJC
-int
-rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc)
-{
-    int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
-    if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= e-p)
-        return MBCLEN_CHARFOUND_LEN(n);
-    else {
-        int min = rb_enc_mbminlen(enc);
-        return min <= e-p ? min : e-p;
-    }
-}
-
-int
-rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
-{
-    int n;
-    if (e <= p)
-        return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
-    n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e);
-    if (e-p < n)
-        return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n-(e-p));
-    return n;
-}
-
-int
-rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
-{
-    int c, l;
-    if (e <= p)
-        return -1;
-    if (rb_enc_asciicompat(enc)) {
-        c = (unsigned char)*p;
-        if (!ISASCII(c))
-            return -1;
-        if (len) *len = 1;
-        return c;
-    }
-    l = rb_enc_precise_mbclen(p, e, enc);
-    if (!MBCLEN_CHARFOUND_P(l))
-        return -1;
-    c = rb_enc_mbc_to_codepoint(p, e, enc);
-    if (!rb_enc_isascii(c, enc))
-        return -1;
-    if (len) *len = l;
-    return c;
-}
-
-int
-rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc)
-{
-    int r;
-    if (e <= p)
-        rb_raise(rb_eArgError, "empty string");
-    r = rb_enc_precise_mbclen(p, e, enc);
-    if (MBCLEN_CHARFOUND_P(r))
-        return rb_enc_mbc_to_codepoint(p, e, enc);
-    else
-	rb_raise(rb_eArgError, "invalid mbstring sequence");
-}
-
-int
-rb_enc_codelen(int c, rb_encoding *enc)
-{
-    int n = ONIGENC_CODE_TO_MBCLEN(enc,c);
-    if (n == 0) {
-	rb_raise(rb_eArgError, "invalid codepoint 0x%x", c);
-    }
-    return n;
-}
-
-int
-rb_enc_toupper(int c, rb_encoding *enc)
-{
-    return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_UPPER_CASE(c):(c));
-}
-
-int
-rb_enc_tolower(int c, rb_encoding *enc)
-{
-    return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_LOWER_CASE(c):(c));
-}
-#endif
-
 /*
  * call-seq:
  *   enc.inspect => string
@@ -903,7 +180,6 @@
 static VALUE
 enc_inspect(VALUE self)
 {
-#if WITH_OBJC
     char buffer[512];
     VALUE enc_name;
     long n;
@@ -914,13 +190,6 @@
 	RSTRING_PTR(enc_name));
 
     return rb_str_new(buffer, n);
-#else
-    VALUE str = rb_sprintf("#<%s:%s%s>", rb_obj_classname(self),
-		      rb_enc_name((rb_encoding*)DATA_PTR(self)),
-		      (ENC_DUMMY_P(self) ? " (dummy)" : ""));
-    ENCODING_CODERANGE_SET(str, rb_usascii_encindex(), ENC_CODERANGE_7BIT);
-    return str;
-#endif
 }
 
 /*
@@ -934,11 +203,7 @@
 static VALUE
 enc_name(VALUE self)
 {
-#if WITH_OBJC
     return (VALUE)CFStringConvertEncodingToIANACharSetName(rb_enc_to_enc(self));
-#else
-    return rb_usascii_str_new2(rb_enc_name((rb_encoding*)DATA_PTR(self)));
-#endif
 }
 
 static VALUE
@@ -968,7 +233,6 @@
 static VALUE
 enc_list(VALUE klass)
 {
-#if WITH_OBJC
     VALUE ary;
     const CFStringEncoding *e;
 
@@ -978,16 +242,6 @@
 	rb_ary_push(ary, enc_make(e));
 	e++;
     }
-#else
-    VALUE ary = rb_ary_new2(enc_table.count);
-    int i;
-    for (i = 0; i < enc_table.count; ++i) {
-	rb_encoding *enc = enc_table.list[i].enc;
-	if (enc) {
-	    rb_ary_push(ary, rb_enc_from_encoding(enc));
-	}
-    }
-#endif
     return ary;
 }
 
@@ -1028,24 +282,10 @@
 static VALUE
 enc_find(VALUE klass, VALUE enc)
 {
-#if WITH_OBJC
     VALUE e = enc_find2(enc);
     if (e == Qnil)
 	rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_BYTEPTR(enc));
     return e;
-#else
-    int idx;
-
-    StringValue(enc);
-    if (!rb_enc_asciicompat(rb_enc_get(enc))) {
-	rb_raise(rb_eArgError, "invalid name encoding (non ASCII)");
-    }
-    idx = rb_enc_find_index(StringValueCStr(enc));
-    if (idx < 0) {
-	rb_raise(rb_eArgError, "unknown encoding name - %s", RSTRING_BYTEPTR(enc));
-    }
-    return rb_enc_from_encoding(rb_enc_from_index(idx));
-#endif
 }
 
 /*
@@ -1091,72 +331,6 @@
     return enc_find(klass, str);
 }
 
-#if !WITH_OBJC
-rb_encoding *
-rb_ascii8bit_encoding(void)
-{
-    if (!enc_table.list) {
-	rb_enc_init();
-    }
-    return enc_table.list[0].enc;
-}
-
-rb_encoding *
-rb_utf8_encoding(void)
-{
-    if (!enc_table.list) {
-	rb_enc_init();
-    }
-    return enc_table.list[ENCINDEX_UTF_8].enc;
-}
-
-rb_encoding *
-rb_usascii_encoding(void)
-{
-    if (!enc_table.list) {
-	rb_enc_init();
-    }
-    return enc_table.list[ENCINDEX_US_ASCII].enc;
-}
-
-int
-rb_usascii_encindex(void)
-{
-    return ENCINDEX_US_ASCII;
-}
-
-rb_encoding *
-rb_locale_encoding(void)
-{
-    VALUE charmap = rb_locale_charmap(rb_cEncoding);
-    int idx;
-
-    if (NIL_P(charmap))
-        idx = rb_enc_find_index("US-ASCII");
-    else
-        idx = rb_enc_find_index(StringValueCStr(charmap));
-    if (idx < 0)
-        return rb_ascii8bit_encoding();
-
-    return rb_enc_from_index(idx);
-}
-
-static int default_external_index;
-
-rb_encoding *
-rb_default_external_encoding(void)
-{
-    return rb_enc_from_index(default_external_index);
-}
-
-VALUE
-rb_enc_default_external(void)
-{
-    return rb_enc_from_encoding(rb_default_external_encoding());
-}
-#endif
-
-#if WITH_OBJC
 static rb_encoding *default_external;
     
 rb_encoding *
@@ -1170,7 +344,6 @@
 {
     return enc_make(default_external);
 }
-#endif
 
 /*
  * call-seq:
@@ -1189,11 +362,7 @@
 void
 rb_enc_set_default_external(VALUE encoding)
 {
-#if WITH_OBJC
     default_external = rb_enc_to_enc_ptr(encoding);
-#else
-    default_external_index = rb_enc_to_index(rb_to_encoding(encoding));
-#endif
 }
 
 /*
@@ -1218,80 +387,10 @@
 VALUE
 rb_locale_charmap(VALUE klass)
 {
-#if WITH_OBJC
     CFStringEncoding enc = CFStringGetSystemEncoding();
     return (VALUE)CFStringConvertEncodingToIANACharSetName(enc);
-#elif defined NO_LOCALE_CHARMAP
-    return rb_usascii_str_new2("ASCII-8BIT");
-#elif defined HAVE_LANGINFO_H
-    char *codeset;
-    codeset = nl_langinfo(CODESET);
-    return rb_usascii_str_new2(codeset);
-#elif defined _WIN32
-    return rb_sprintf("CP%d", GetACP());
-#else
-    return Qnil;
-#endif
 }
 
-#if !WITH_OBJC
-static void
-set_encoding_const(const char *name, rb_encoding *enc)
-{
-    VALUE encoding = rb_enc_from_encoding(enc);
-    char *s = (char *)name;
-    int haslower = 0, hasupper = 0, valid = 0;
-
-    if (ISDIGIT(*s)) return;
-    if (ISUPPER(*s)) {
-	hasupper = 1;
-	while (*++s && (ISALNUM(*s) || *s == '_')) {
-	    if (ISLOWER(*s)) haslower = 1;
-	}
-    }
-    if (!*s) {
-	valid = 1;
-	rb_define_const(rb_cEncoding, name, encoding);
-    }
-    if (!valid || haslower) {
-	int len = strlen(name) + 1;
-	if (!haslower || !hasupper) {
-	    do {
-		if (ISLOWER(*s)) haslower = 1;
-		if (ISUPPER(*s)) hasupper = 1;
-	    } while (*++s && (!haslower || !hasupper));
-	}
-	MEMCPY(s = ALLOCA_N(char, len), name, char, len);
-	name = s;
-	if (!valid) {
-	    if (ISLOWER(*s)) *s = ONIGENC_ASCII_CODE_TO_UPPER_CASE((int)*s);
-	    for (; *s; ++s) {
-		if (!ISALNUM(*s)) *s = '_';
-	    }
-	    if (hasupper) {
-		rb_define_const(rb_cEncoding, name, encoding);
-	    }
-	}
-	if (haslower) {
-	    for (s = (char *)name; *s; ++s) {
-		if (ISLOWER(*s)) *s = ONIGENC_ASCII_CODE_TO_UPPER_CASE((int)*s);
-	    }
-	    rb_define_const(rb_cEncoding, name, encoding);
-	}
-    }
-}
-
-static int
-rb_enc_name_list_i(st_data_t name, st_data_t idx, st_data_t arg)
-{
-    VALUE ary = (VALUE)arg;
-    VALUE str = rb_usascii_str_new2((char *)name);
-    OBJ_FREEZE(str);
-    rb_ary_push(ary, str);
-    return ST_CONTINUE;
-}
-#endif
-
 /*
  * call-seq:
  *   Encoding.name_list => ["enc1", "enc2", ...]
@@ -1311,7 +410,6 @@
 static VALUE
 rb_enc_name_list(VALUE klass)
 {
-#if WITH_OBJC
     VALUE ary, list;
     long i, count;
 
@@ -1319,39 +417,9 @@
     list = enc_list(klass);
     for (i = 0, count = RARRAY_LEN(list); i < count; i++)
 	rb_ary_push(ary, enc_name(RARRAY_AT(list, i)));
-#else
-    VALUE ary = rb_ary_new2(enc_table.names->num_entries);
-    st_foreach(enc_table.names, rb_enc_name_list_i, (st_data_t)ary);
-#endif
     return ary;
 }
 
-#if !WITH_OBJC
-static int
-rb_enc_aliases_enc_i(st_data_t name, st_data_t orig, st_data_t arg)
-{
-    VALUE *p = (VALUE *)arg;
-    VALUE aliases = p[0], ary = p[1];
-    int idx = (int)orig;
-    VALUE key, str = rb_ary_entry(ary, idx);
-
-    if (NIL_P(str)) {
-	rb_encoding *enc = rb_enc_from_index(idx);
-
-	if (STRCASECMP((char*)name, rb_enc_name(enc)) == 0) {
-	    return ST_CONTINUE;
-	}
-	str = rb_usascii_str_new2(rb_enc_name(enc));
-	OBJ_FREEZE(str);
-	rb_ary_store(ary, idx, str);
-    }
-    key = rb_usascii_str_new2((char *)name);
-    OBJ_FREEZE(key);
-    rb_hash_aset(aliases, key, str);
-    return ST_CONTINUE;
-}
-#endif
-
 /*
  * call-seq:
  *   Encoding.aliases => {"alias1" => "orig1", "alias2" => "orig2", ...}
@@ -1367,18 +435,10 @@
 static VALUE
 rb_enc_aliases(VALUE klass)
 {
-#if WITH_OBJC
     /* TODO: the CFString IANA <-> charset code does support aliases, we should
      * find a way to return them here. 
      */
     return rb_hash_new();
-#else
-    VALUE aliases[2];
-    aliases[0] = rb_hash_new();
-    aliases[1] = rb_ary_new();
-    st_foreach(enc_table.names, rb_enc_aliases_enc_i, (st_data_t)aliases);
-    return aliases[0];
-#endif
 }
 
 VALUE

Modified: MacRuby/branches/lrz_unstable/object.c
===================================================================
--- MacRuby/branches/lrz_unstable/object.c	2008-08-16 02:25:22 UTC (rev 448)
+++ MacRuby/branches/lrz_unstable/object.c	2008-08-16 08:35:51 UTC (rev 449)
@@ -1,16 +1,14 @@
-/**********************************************************************
+/* 
+ * MacRuby implementation of Ruby 1.9's object.c.
+ *
+ * This file is covered by the Ruby license. See COPYING for more details.
+ * 
+ * Copyright (C) 2007-2008, Apple Inc. All rights reserved.
+ * Copyright (C) 1993-2007 Yukihiro Matsumoto
+ * Copyright (C) 2000 Network Applied Communication Laboratory, Inc.
+ * Copyright (C) 2000 Information-technology Promotion Agency, Japan
+ */
 
-  object.c -
-
-  $Author: nobu $
-  created at: Thu Jul 15 12:01:24 JST 1993
-
-  Copyright (C) 1993-2007 Yukihiro Matsumoto
-  Copyright (C) 2000  Network Applied Communication Laboratory, Inc.
-  Copyright (C) 2000  Information-technology Promotion Agency, Japan
-
-**********************************************************************/
-
 #include "ruby/ruby.h"
 #include "ruby/st.h"
 #include "ruby/util.h"
@@ -24,9 +22,7 @@
 
 VALUE rb_cBasicObject;
 VALUE rb_mKernel;
-#if WITH_OBJC
 VALUE rb_cNSObject;
-#endif
 VALUE rb_cObject;
 VALUE rb_cModule;
 VALUE rb_cClass;
@@ -130,7 +126,6 @@
 VALUE
 rb_class_real(VALUE cl)
 {
-#if WITH_OBJC
     if (cl == 0)
         return 0;
     if (RCLASS_META(cl))
@@ -139,14 +134,6 @@
 	cl = RCLASS_SUPER(cl);
     }
     return cl;
-#else
-    if (cl == 0)
-        return 0;
-    while ((RBASIC(cl)->flags & FL_SINGLETON) || BUILTIN_TYPE(cl) == T_ICLASS) {
-	cl = RCLASS_SUPER(cl);
-    }
-    return cl;
-#endif
 }
 
 /*
@@ -172,13 +159,11 @@
 static void
 init_copy(VALUE dest, VALUE obj)
 {
-#if WITH_OBJC
     if (NATIVE(obj)) {
 	if (rb_objc_flag_check((const void *)obj, FL_TAINT))
 	    rb_objc_flag_set((const void *)dest, FL_TAINT, true);
 	goto call_init_copy;
     }
-#endif
     if (OBJ_FROZEN(dest)) {
         rb_raise(rb_eTypeError, "[bug] frozen object (%s) allocated", rb_obj_classname(dest));
     }
@@ -187,8 +172,12 @@
     rb_copy_generic_ivar(dest, obj);
     rb_gc_copy_finalizer(dest, obj);
     switch (TYPE(obj)) {
+      case T_NATIVE:
+	if (rb_objc_flag_check((const void *)obj, FL_TAINT))
+	    rb_objc_flag_set((const void *)dest, FL_TAINT, true);
+        break;
+
       case T_OBJECT:
-#if WITH_OBJC
 	ROBJECT(dest)->ivars.type = ROBJECT(obj)->ivars.type;
 	switch (RB_IVAR_TYPE(ROBJECT(obj)->ivars)) {
 	    case RB_IVAR_ARY:
@@ -216,31 +205,8 @@
 	    break;
 	}
 	break;
-#else
-        if (!(RBASIC(dest)->flags & ROBJECT_EMBED) && ROBJECT_IVPTR(dest)) {
-            xfree(ROBJECT_IVPTR(dest));
-            ROBJECT(dest)->as.heap.ivptr = 0;
-            ROBJECT(dest)->as.heap.numiv = 0;
-            ROBJECT(dest)->as.heap.iv_index_tbl = 0;
-        }
-        if (RBASIC(obj)->flags & ROBJECT_EMBED) {
-            MEMCPY(ROBJECT(dest)->as.ary, ROBJECT(obj)->as.ary, VALUE, ROBJECT_EMBED_LEN_MAX);
-            RBASIC(dest)->flags |= ROBJECT_EMBED;
-        }
-        else {
-            long len = ROBJECT(obj)->as.heap.numiv;
-            VALUE *ptr = ALLOC_N(VALUE, len);
-            MEMCPY(ptr, ROBJECT(obj)->as.heap.ivptr, VALUE, len);
-            ROBJECT(dest)->as.heap.ivptr = ptr;
-            ROBJECT(dest)->as.heap.numiv = len;
-            ROBJECT(dest)->as.heap.iv_index_tbl = ROBJECT(obj)->as.heap.iv_index_tbl;
-            RBASIC(dest)->flags &= ~ROBJECT_EMBED;
-        }
-#endif
-        break;
       case T_CLASS:
       case T_MODULE:
-#if WITH_OBJC
 	{
 	    CFMutableDictionaryRef dest_dict, obj_dict;
 	    
@@ -258,15 +224,6 @@
 		    rb_class_ivar_set_dict(dest, NULL);
 	    }
 	}
-#else
-	if (RCLASS_IV_TBL(dest)) {
-	    st_free_table(RCLASS_IV_TBL(dest));
-	    RCLASS_IV_TBL(dest) = 0;
-	}
-	if (RCLASS_IV_TBL(obj)) {
-	    RCLASS_IV_TBL(dest) = st_copy(RCLASS_IV_TBL(obj));
-	}
-#endif
         break;
     }
 call_init_copy:
@@ -307,7 +264,6 @@
     if (rb_special_const_p(obj)) {
         rb_raise(rb_eTypeError, "can't clone %s", rb_obj_classname(obj));
     }
-#if WITH_OBJC
     switch (TYPE(obj)) {
 	case T_NATIVE:
 	    clone = rb_obj_alloc(rb_obj_class(obj));
@@ -327,13 +283,6 @@
     init_copy(clone, obj);
     if (OBJ_FROZEN(obj))
 	OBJ_FREEZE(clone);
-#else
-    clone = rb_obj_alloc(rb_obj_class(obj));
-    RBASIC(clone)->klass = rb_singleton_class_clone(obj);
-    RBASIC(clone)->flags = (RBASIC(obj)->flags | FL_TEST(clone, FL_TAINT)) & ~(FL_FREEZE|FL_FINALIZE);
-    init_copy(clone, obj);
-    RBASIC(clone)->flags |= RBASIC(obj)->flags & FL_FREEZE;
-#endif
 
     return clone;
 }
@@ -370,13 +319,11 @@
     return dup;
 }
 
-#if WITH_OBJC
 static VALUE
 rb_nsobj_dup(VALUE obj)
 {
     return (VALUE)objc_msgSend((id)obj, selCopy); 
 }
-#endif
 
 /* :nodoc: */
 VALUE
@@ -384,11 +331,8 @@
 {
     if (obj == orig) return obj;
     rb_check_frozen(obj);
-#if WITH_OBJC
     if (TYPE(obj) != TYPE(orig)) {
-#else
-    if (TYPE(obj) != TYPE(orig) || rb_obj_class(obj) != rb_obj_class(orig)) {
-#endif
+	/* FIXME rb_obj_class(obj) != rb_obj_class(orig) */
 	rb_raise(rb_eTypeError, "initialize_copy should take same class object");
     }
     return obj;
@@ -436,11 +380,7 @@
     if (!rb_is_instance_id(id)) return ST_CONTINUE;
 
     if (cstr[0] == '-') { /* first element */
-#if WITH_OBJC
 	rb_str_update(str, 0, 0, rb_str_new2("#"));
-#else
-	RSTRING_BYTEPTR(str)[0] = '#';
-#endif
 	rb_str_cat2(str, " ");
     }
     else {
@@ -466,11 +406,7 @@
 	rb_ivar_foreach(obj, inspect_i, str);
     }
     rb_str_cat2(str, ">");
-#if WITH_OBJC
     rb_str_update(str, 0, 0, rb_str_new2("#"));
-#else
-    RSTRING_BYTEPTR(str)[0] = '#';
-#endif
     OBJ_INFECT(str, obj);
 
     return str;
@@ -495,7 +431,6 @@
 
     if (TYPE(obj) == T_OBJECT) {
         int has_ivar = 0;
-#if WITH_OBJC
 	switch (RB_IVAR_TYPE(ROBJECT(obj)->ivars)) {
 	    case RB_IVAR_ARY:
 	    {
@@ -518,19 +453,6 @@
 		    	    > 0;
 		break;
 	}
-#else
-        VALUE *ptr = ROBJECT_IVPTR(obj);
-        long len = ROBJECT_NUMIV(obj);
-        long i;
-
-        for (i = 0; i < len; i++) {
-            if (ptr[i] != Qundef) {
-                has_ivar = 1;
-                break;
-            }
-        }
-#endif
-
         if (has_ivar) {
             VALUE str;
             const char *c = rb_obj_classname(obj);
@@ -610,11 +532,7 @@
     }
 
     while (cl) {
-#if WITH_OBJC
 	if (cl == c) // TODO check included modules
-#else
-	if (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))
-#endif
 	    return Qtrue;
 	cl = RCLASS_SUPER(cl);
     }
@@ -794,11 +712,9 @@
 VALUE
 rb_obj_tainted(VALUE obj)
 {
-#if WITH_OBJC
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
 	return rb_objc_flag_check((const void *)obj, FL_TAINT) ? Qtrue : Qfalse;
     }
-#endif
     if (FL_TEST(obj, FL_TAINT))
 	return Qtrue;
     return Qfalse;
@@ -817,12 +733,10 @@
 rb_obj_taint(VALUE obj)
 {
     rb_secure(4);
-#if WITH_OBJC
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
 	rb_objc_flag_set((const void *)obj, FL_TAINT, true);
 	return obj;
     }
-#endif
     if (!OBJ_TAINTED(obj)) {
 	if (OBJ_FROZEN(obj)) {
 	    rb_error_frozen("object");
@@ -844,12 +758,10 @@
 rb_obj_untaint(VALUE obj)
 {
     rb_secure(3);
-#if WITH_OBJC
     if (!SPECIAL_CONST_P(obj) && NATIVE(obj)) {
 	rb_objc_flag_set((const void *)obj, FL_TAINT, false);
 	return obj;
     }
-#endif
     if (OBJ_TAINTED(obj)) {
 	if (OBJ_FROZEN(obj)) {
 	    rb_error_frozen("object");
@@ -901,14 +813,12 @@
 	    }
 	    st_insert(immediate_frozen_tbl, obj, (st_data_t)Qtrue);
 	}
-#if WITH_OBJC
 	else if (NATIVE(obj)) {
 	    rb_objc_flag_set((const void *)obj, FL_FREEZE, true);
 	}
 	else if ((type = TYPE(obj)) == T_CLASS || type == T_MODULE) {
 	    RCLASS_SET_VERSION_FLAG(obj, RCLASS_IS_FROZEN);
 	}
-#endif
 	else {
 	    FL_SET(obj, FL_FREEZE);
 	}
@@ -935,7 +845,6 @@
 	if (st_lookup(immediate_frozen_tbl, obj, 0)) return Qtrue;
 	return Qfalse;
     }
-#if WITH_OBJC
     switch (TYPE(obj)) {
 	case T_STRING:
 	case T_ARRAY:
@@ -951,10 +860,6 @@
 	default:
 	    return FL_TEST(obj, FL_FREEZE) ? Qtrue : Qfalse;
     }
-#else
-    if (FL_TEST(obj, FL_FREEZE)) return Qtrue;
-    return Qfalse;
-#endif
 }
 
 
@@ -1363,7 +1268,6 @@
       default:
 	rb_raise(rb_eTypeError, "compared with non class/module");
     }
-#if WITH_OBJC
     while (mod) {
 	if (mod == arg)
 	    return Qtrue;
@@ -1375,19 +1279,6 @@
 	    return Qfalse;
 	arg = RCLASS_SUPER(arg);
     }
-#else
-    while (mod) {
-	if (RCLASS_M_TBL(mod) == RCLASS_M_TBL(arg))
-	    return Qtrue;
-	mod = RCLASS_SUPER(mod);
-    }
-    /* not mod < arg; check if mod > arg */
-    while (arg) {
-	if (RCLASS_M_TBL(arg) == RCLASS_M_TBL(start))
-	    return Qfalse;
-	arg = RCLASS_SUPER(arg);
-    }
-#endif
     return Qnil;
 }
 
@@ -1492,9 +1383,6 @@
 {
     VALUE mod = rb_module_new();
 
-#if !WITH_OBJC
-    RBASIC(mod)->klass = klass;
-#endif
     return mod;
 }
 
@@ -1553,11 +1441,6 @@
 {
     VALUE super;
 
-#if !WITH_OBJC
-    if (RCLASS_SUPER(klass) != 0) {
-	rb_raise(rb_eTypeError, "already initialized class");
-    }
-#endif
     if (argc == 0) {
 	super = rb_cObject;
     }
@@ -1566,11 +1449,7 @@
 	rb_check_inheritable(super);
     }
     RCLASS_SUPER(klass) = super;
-#if WITH_OBJC
     rb_objc_install_primitives((Class)klass, (Class)super);
-#else
-    rb_make_metaclass(klass, RBASIC(super)->klass);
-#endif
     rb_class_inherited(super, klass);
     rb_mod_initialize(klass);
 
@@ -1598,24 +1477,9 @@
 	rb_raise(rb_eTypeError, "can't create instance of singleton class");
     }
     obj = rb_funcall(klass, ID_ALLOCATOR, 0, 0);
-#if !WITH_OBJC
-    if (rb_obj_class(obj) != rb_class_real(klass)) {
-	rb_raise(rb_eTypeError, "wrong instance allocation");
-    }
-#endif
     return obj;
 }
 
-#if !WITH_OBJC
-static VALUE
-rb_class_allocate_instance(VALUE klass)
-{
-    NEWOBJ(obj, struct RObject);
-    OBJSETUP(obj, klass, T_OBJECT);
-    return (VALUE)obj;
-}
-#endif
-
 /*
  *  call-seq:
  *     class.new(args, ...)    =>  obj
@@ -1650,39 +1514,6 @@
 
 /*
  *  call-seq:
- *     class.superclass -> a_super_class or nil
- *  
- *  Returns the superclass of <i>class</i>, or <code>nil</code>.
- *     
- *     File.superclass          #=> IO
- *     IO.superclass            #=> Object
- *     Object.superclass        #=> BasicObject
- *     BasicObject.superclass   #=> nil
- *     
- */
-
-#if !WITH_OBJC
-static VALUE
-rb_class_superclass(VALUE klass)
-{
-    VALUE super = RCLASS_SUPER(klass);
-
-    if (!super) {
-	if (klass == rb_cBasicObject) return Qnil;
-	rb_raise(rb_eTypeError, "uninitialized class");
-    }
-    while (TYPE(super) == T_ICLASS) {
-	super = RCLASS_SUPER(super);
-    }
-    if (!super) {
-	return Qnil;
-    }
-    return super;
-}
-#endif
-
-/*
- *  call-seq:
  *     attr_reader(symbol, ...)    => nil
  *     attr(symbol, ...)             => nil
  *  
@@ -2499,19 +2330,12 @@
 {
     ID id = rb_intern(name);
     extern st_table *rb_class_tbl;
-#if WITH_OBJC
     VALUE obj = rb_objc_create_class(name, super);
-#else
-    VALUE obj = rb_class_boot(super);
-
-    rb_name_class(obj, id);
-#endif
     st_add_direct(rb_class_tbl, id, obj);
     rb_const_set((rb_cObject ? rb_cObject : obj), id, obj);
     return obj;
 }
 
-#if WITH_OBJC
 static VALUE
 rb_obj_is_native(VALUE recv)
 {
@@ -2523,7 +2347,6 @@
 {
     return RCLASS_META(klass) ? Qtrue : Qfalse;
 }
-#endif
 
 /*
  *  Document-class: Class
@@ -2607,40 +2430,18 @@
 void
 Init_Object(void)
 {
-#if WITH_OBJC
     rb_cNSObject = rb_cObject = (VALUE)objc_getClass("NSObject");
     rb_const_set(rb_cObject, rb_intern("Object"), rb_cNSObject);
     rb_cBasicObject = rb_cObject; // TODO
     rb_cModule = boot_defclass("Module", rb_cObject);
     rb_cClass =  boot_defclass("Class",  rb_cModule);
     RCLASS_SUPER(*(Class *)rb_cNSObject) = rb_cClass;
-#else
-    VALUE metaclass;
 
-    rb_cBasicObject = boot_defclass("BasicObject", 0);
-    rb_cObject = boot_defclass("Object", rb_cBasicObject);
-    rb_cModule = boot_defclass("Module", rb_cObject);
-    rb_cClass =  boot_defclass("Class",  rb_cModule);
-
-    metaclass = rb_make_metaclass(rb_cBasicObject, rb_cClass);
-    metaclass = rb_make_metaclass(rb_cObject, metaclass);
-    metaclass = rb_make_metaclass(rb_cModule, metaclass);
-    metaclass = rb_make_metaclass(rb_cClass, metaclass);
-#endif
-
     rb_define_private_method(rb_cBasicObject, "initialize", rb_obj_dummy, 0);
-#if WITH_OBJC
     rb_define_method(rb_cNSObject, "==", rb_obj_equal, 1);
     rb_define_method(rb_cNSObject, "equal?", rb_obj_equal, 1);
     rb_define_method(rb_cNSObject, "!", rb_obj_not, 0);
     rb_define_method(rb_cNSObject, "!=", rb_obj_not_equal, 1);
-#else
-    rb_define_alloc_func(rb_cBasicObject, rb_class_allocate_instance);
-    rb_define_method(rb_cBasicObject, "==", rb_obj_equal, 1);
-    rb_define_method(rb_cBasicObject, "equal?", rb_obj_equal, 1);
-    rb_define_method(rb_cBasicObject, "!", rb_obj_not, 0);
-    rb_define_method(rb_cBasicObject, "!=", rb_obj_not_equal, 1);
-#endif
 
     rb_define_private_method(rb_cBasicObject, "singleton_method_added", rb_obj_dummy, 1);
     rb_define_private_method(rb_cBasicObject, "singleton_method_removed", rb_obj_dummy, 1);
@@ -2661,19 +2462,8 @@
     rb_define_method(rb_mKernel, "!~", rb_obj_not_match, 1);
     rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1);
 
-#if !WITH_OBJC 
-    /* NSObject#class already exists */
-    rb_define_method(rb_mKernel, "class", rb_obj_class, 0);
-#endif
-
-#if WITH_OBJC
     rb_define_method(rb_cNSObject, "clone", rb_obj_clone, 0);
     rb_define_method(rb_cNSObject, "dup", rb_nsobj_dup, 0);
-#else
-    rb_define_method(rb_mKernel, "clone", rb_obj_clone, 0);
-    rb_define_method(rb_mKernel, "dup", rb_obj_dup, 0);
-    rb_define_method(rb_mKernel, "initialize_copy", rb_obj_init_copy, 1);
-#endif
 
     rb_define_method(rb_mKernel, "taint", rb_obj_taint, 0);
     rb_define_method(rb_mKernel, "tainted?", rb_obj_tainted, 0);
@@ -2700,9 +2490,7 @@
     rb_define_method(rb_mKernel, "is_a?", rb_obj_is_kind_of, 1);
     rb_define_method(rb_mKernel, "tap", rb_obj_tap, 0);
 
-#if WITH_OBJC
     rb_define_method(rb_mKernel, "__native__?", rb_obj_is_native, 0);
-#endif
 
     rb_define_global_function("sprintf", rb_f_sprintf, -1); /* in sprintf.c */
     rb_define_global_function("format", rb_f_sprintf, -1);  /* in sprintf.c */
@@ -2742,10 +2530,8 @@
     rb_define_method(rb_cModule, "include?", rb_mod_include_p, 1); /* in class.c */
     rb_define_method(rb_cModule, "name", rb_mod_name, 0);  /* in variable.c */
     rb_define_method(rb_cModule, "ancestors", rb_mod_ancestors, 0); /* in class.c */
-#if WITH_OBJC
     rb_define_private_method(rb_cModule, "ib_outlet", rb_mod_objc_ib_outlet, -1); /* in objc.m */
     rb_define_method(rb_cClass, "__meta__?", rb_class_is_meta, 0);
-#endif
 
     rb_define_private_method(rb_cModule, "attr", rb_mod_attr, -1);
     rb_define_private_method(rb_cModule, "attr_reader", rb_mod_attr_reader, -1);
@@ -2782,10 +2568,6 @@
     rb_define_method(rb_cClass, "new", rb_class_new_instance, -1);
     rb_define_method(rb_cClass, "initialize", rb_class_initialize, -1);
     rb_define_method(rb_cClass, "initialize_copy", rb_class_init_copy, 1); /* in class.c */
-#if !WITH_OBJC
-    /* already defined */
-    rb_define_method(rb_cClass, "superclass", rb_class_superclass, 0);
-#endif
     rb_define_alloc_func(rb_cClass, rb_class_s_alloc);
     rb_undef_method(rb_cClass, "extend_object");
     rb_undef_method(rb_cClass, "append_features");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-changes/attachments/20080816/24f8f602/attachment-0001.html 


More information about the macruby-changes mailing list