diff --git a/ChangeLog b/ChangeLog index f08e5fb..bf528e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,3 @@ -Wed Jul 30 17:45:21 2003 Nicola Pero - - * Protocol.m ([-conformsTo:]): If the argument is nil, return NO. - ([-hash], [-isEqual:]): New methods. - (Suggestion by Jeremy Bettis ) - -2001-07-04 Richard Frith-Macdonald - - * Protocol.m: ([-descriptionForClassMethod:]) - ([-descriptionForInstanceMethod:]) fix dereference of null pointer. - 2003-02-20 Alexandre Oliva * configure.in: Propagate ORIGINAL_LD_FOR_MULTILIBS to diff --git a/ChangeLog.GNUstep b/ChangeLog.GNUstep index d547b63..3b197ab 100644 --- a/ChangeLog.GNUstep +++ b/ChangeLog.GNUstep @@ -1,3 +1,25 @@ +2003-08-12 Adam Fedor + + * thr-posix.c (__objc_thread_set_priority): Don't use if + __OpenBSD__ + +2003-08-12 Jeremy Bettis + + * 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 + + * Protocol.m ([-conformsTo:]): If the argument is nil, return NO. + ([-hash], [-isEqual:]): New methods. + (Suggestion by Jeremy Bettis ) + +2001-07-04 Richard Frith-Macdonald + + * Protocol.m: ([-descriptionForClassMethod:]) + ([-descriptionForInstanceMethod:]) fix dereference of null pointer. + 2003-06-27 Adam Fedor * thr-posix.c: Add sched_param struct if missing diff --git a/sendmsg.c b/sendmsg.c index ea22356..402a8ab 100644 --- a/sendmsg.c +++ b/sendmsg.c @@ -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) diff --git a/thr-posix.c b/thr-posix.c index 410d6fd..4dda0cb 100644 --- a/thr-posix.c +++ b/thr-posix.c @@ -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;