Protocol hack for gcc < 3.3

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/libobjc/trunk@17470 72102866-910b-0410-8b05-ffd578937521
main
fedor 23 years ago
parent af66f991cb
commit 8768c1ee7c

@ -1,14 +1,3 @@
Wed Jul 30 17:45:21 2003 Nicola Pero <n.pero@mi.flashnet.it>
* Protocol.m ([-conformsTo:]): If the argument is nil, return NO.
([-hash], [-isEqual:]): New methods.
(Suggestion by Jeremy Bettis <jeremy@deadbeef.com>)
2001-07-04 Richard Frith-Macdonald <rrfm@gnu.org>
* Protocol.m: ([-descriptionForClassMethod:])
([-descriptionForInstanceMethod:]) fix dereference of null pointer.
2003-02-20 Alexandre Oliva <aoliva@redhat.com>
* configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to

@ -1,3 +1,25 @@
2003-08-12 Adam Fedor <fedor@gnu.org>
* thr-posix.c (__objc_thread_set_priority): Don't use if
__OpenBSD__
2003-08-12 Jeremy Bettis <jeremy@deadbeef.com>
* sendmsg.c (objc_msg_lookup): If GCC < 3.3, if the receiver
object has a class pointer which is equal to the PROTOCOL_VERSION
number (0x2), then make it into a proper Protocol object.
Wed Jul 30 17:45:21 2003 Nicola Pero <n.pero@mi.flashnet.it>
* Protocol.m ([-conformsTo:]): If the argument is nil, return NO.
([-hash], [-isEqual:]): New methods.
(Suggestion by Jeremy Bettis <jeremy@deadbeef.com>)
2001-07-04 Richard Frith-Macdonald <rrfm@gnu.org>
* Protocol.m: ([-descriptionForClassMethod:])
([-descriptionForInstanceMethod:]) fix dereference of null pointer.
2003-06-27 Adam Fedor <fedor@gnu.org>
* thr-posix.c: Add sched_param struct if missing

@ -174,6 +174,22 @@ objc_msg_lookup (id receiver, SEL op)
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)

@ -102,7 +102,7 @@ __objc_thread_detach(void (*func)(void *arg), void *arg)
int
__objc_thread_set_priority(int priority)
{
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && !defined(__OpenBSD__)
pthread_t thread_id = pthread_self();
int policy;
struct sched_param params;

Loading…
Cancel
Save