Fixed object_is_class and object_is_metaclass

From-SVN: r44039
This commit is contained in:
Nicola Pero 2001-07-16 13:36:24 +02:00 committed by Nicola Pero
parent 0ae854922a
commit 42d28de5b2
2 changed files with 19 additions and 10 deletions

View File

@ -1,3 +1,10 @@
Mon Jul 16 12:15:00 2001 Nicola Pero <n.pero@mi.flashnet.it>
* objc/objc-api.h (object_is_class): Fixed - buggy code was trying
to cast an id to a Class, which can not be done. Make the check
by using CLS_ISMETA on the class pointer instead.
(object_is_meta_class): Similar fix.
2001-06-09 Alexandre Oliva <aoliva@redhat.com>, Stephen L Moshier <moshier@mediaone.net>
* configure.in (AC_EXEEXT): Work around in case it expands to

View File

@ -578,21 +578,23 @@ object_get_super_class
}
static inline BOOL
object_is_class(id object)
object_is_class (id object)
{
return CLS_ISCLASS((Class)object);
return ((object != nil) && CLS_ISMETA (object->class_pointer));
}
static inline BOOL
object_is_instance (id object)
{
return ((object != nil) && CLS_ISCLASS (object->class_pointer));
}
static inline BOOL
object_is_instance(id object)
object_is_meta_class (id object)
{
return (object!=nil)&&CLS_ISCLASS(object->class_pointer);
}
static inline BOOL
object_is_meta_class(id object)
{
return CLS_ISMETA((Class)object);
return ((object != nil)
&& !object_is_instance (object)
&& !object_is_class (object));
}
struct sarray*