Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -130,7 +130,29 @@ extern void objc_thread_add(void); extern void objc_thread_remove(void); extern void objc_exit(void); extern objc_uncaught_exception_handler objc_setUncaughtExceptionHandler( objc_uncaught_exception_handler); + +static inline Class +object_getClass(id obj_) +{ + struct objc_object *obj = (struct objc_object*)obj_; + + return obj->isa; +} + +static inline void +object_setClass(id obj_, Class cls) +{ + struct objc_object *obj = (struct objc_object*)obj_; + + obj->isa = cls; +} + +static inline const char* +object_getClassName(id obj) +{ + return class_getName(object_getClass(obj)); +} #endif