Index: init.c =================================================================== RCS file: /cvsroot/gnustep/gnustep/dev-libs/libobjc/init.c,v retrieving revision 1.9 diff -u -r1.9 init.c --- init.c 20 May 2003 06:21:01 -0000 1.9 +++ init.c 26 Jul 2005 16:39:21 -0000 @@ -458,8 +458,8 @@ haven't been here before. However, the comparison is to be reminded of taking into account class posing and to think about possible semantics... */ - else if (class != statics->instances[0]->class_pointer) - { + else + { id *inst; for (inst = &statics->instances[0]; *inst; inst++) @@ -475,7 +475,7 @@ statically allocated instances, besides the trivial NXConstantString, anyway? */ } - } + } } if (module_initialized) { @@ -883,6 +883,9 @@ (int) ((char *) protos->list[i]->class_pointer - (char *) 0), PROTOCOL_VERSION); + } else { + /* even if the protocol is initialized, the super protos might not be */ + __objc_init_protocols (aProto->protocol_list); } } Index: sendmsg.c =================================================================== RCS file: /cvsroot/gnustep/gnustep/dev-libs/libobjc/sendmsg.c,v retrieving revision 1.5 diff -u -r1.5 sendmsg.c --- sendmsg.c 13 Aug 2003 03:02:23 -0000 1.5 +++ sendmsg.c 26 Jul 2005 16:42:12 -0000 @@ -174,22 +174,6 @@ IMP result; if (receiver) { -#if __GNUC__ < 3 || (__GNUC__ == 3&& __GNUC_MINOR__ < 3) -#define PROTOCOL_VERSION 2 // needs to match what is in init.c - // This is a dirty hack for GCC < 3.3 - // Protocols that are referenced in a module, but not implemented by a - // class declared in that same module never get initialized, so if - // we see the magic number PROTOCOL_VERSION, then the object must be - // a Protocol. It may be just corrupted memory, but in that case - // we are going to crash anyway, so no harm done. - if (receiver->class_pointer == (void*)PROTOCOL_VERSION) { - static Class proto_class = 0; - if (!proto_class) - proto_class = objc_lookup_class ("Protocol"); - if (proto_class) - receiver->class_pointer = proto_class; - } -#endif result = sarray_get_safe (receiver->class_pointer->dtable, (sidx)op->sel_id); if (result == 0)