Index: src/macros.h ================================================================== --- src/macros.h +++ src/macros.h @@ -116,14 +116,10 @@ fprintf(stderr, "Failed to ensure condition in " \ __FILE__ ":%d:\n" #cond "\n", __LINE__); \ abort(); \ } -#ifdef OF_OBJFW_RUNTIME -# define objc_lookUpClass objc_lookup_class -#endif - #ifndef _WIN32 # define OF_PATH_DELIMITER '/' #else # define OF_PATH_DELIMITER '\\' #endif Index: src/runtime/class.m ================================================================== --- src/runtime/class.m +++ src/runtime/class.m @@ -352,12 +352,12 @@ OBJC_ERROR("Not enough memory for load queue!"); } } } -Class -objc_lookup_class(const char *name) +id +objc_lookUpClass(const char *name) { Class cls = objc_classname_to_class(name); if (cls == NULL) return Nil; @@ -375,20 +375,38 @@ return Nil; return cls; } -Class -objc_get_class(const char *name) +id +objc_getClass(const char *name) +{ + return objc_lookUpClass(name); +} + +id +objc_getRequiredClass(const char *name) { Class cls; - if ((cls = objc_lookup_class(name)) == Nil) + if ((cls = objc_getClass(name)) == Nil) OBJC_ERROR("Class %s not found!", name); return cls; } + +Class +objc_lookup_class(const char *name) +{ + return objc_getClass(name); +} + +Class +objc_get_class(const char *name) +{ + return objc_getRequiredClass(name); +} const char* class_getName(Class cls) { return cls->name; Index: src/runtime/exception.m ================================================================== --- src/runtime/exception.m +++ src/runtime/exception.m @@ -435,11 +435,14 @@ c = (uintptr_t)read_value(lsda->typestable_enc, &tmp); c = (uintptr_t)resolve_value(c, lsda->typestable_enc, lsda->typestable - i, lsda->typestable_base); #endif - class = (c != 0 ? objc_get_class((const char*)c) : Nil); + if (c != 0) + class = objc_getRequiredClass((const char*)c); + else + class = Nil; if (class_matches(class, e->object)) { *filtervalue = filter; return HANDLER_FOUND; } Index: src/runtime/runtime.h ================================================================== --- src/runtime/runtime.h +++ src/runtime/runtime.h @@ -167,12 +167,13 @@ typedef void (*objc_uncaught_exception_handler)(id); extern SEL sel_registerName(const char*); extern const char* sel_getName(SEL); extern BOOL sel_isEqual(SEL, SEL); -extern Class objc_get_class(const char*); -extern Class objc_lookup_class(const char*); +extern id objc_lookUpClass(const char*); +extern id objc_getClass(const char*); +extern id objc_getRequiredClass(const char*); extern const char* class_getName(Class); extern Class class_getSuperclass(Class); extern BOOL class_isKindOfClass(Class, Class); extern unsigned long class_getInstanceSize(Class); extern BOOL class_respondsToSelector(Class, SEL); Index: src/runtime/static-instances.m ================================================================== --- src/runtime/static-instances.m +++ src/runtime/static-instances.m @@ -31,11 +31,11 @@ struct objc_abi_static_instances **si; size_t i; /* Check if the class for a static instance became available */ for (i = 0; i < static_instances_cnt; i++) { - Class cls = objc_lookup_class(static_instances[i]->class_name); + Class cls = objc_lookUpClass(static_instances[i]->class_name); if (cls != Nil) { id *instances; for (instances = static_instances[i]->instances; @@ -68,11 +68,11 @@ if (si == NULL) return; for (; *si != NULL; si++) { - Class cls = objc_lookup_class((*si)->class_name); + Class cls = objc_lookUpClass((*si)->class_name); if (cls != Nil) { id *instances; for (instances = (*si)->instances; *instances != nil; Index: tests/OFBlockTests.m ================================================================== --- tests/OFBlockTests.m +++ tests/OFBlockTests.m @@ -23,13 +23,10 @@ #if defined(OF_OBJFW_RUNTIME) # include "runtime.h" #elif defined(OF_APPLE_RUNTIME) # include #endif -#ifdef OF_OBJFW_RUNTIME -# define objc_getClass objc_get_class -#endif #import "TestsAppDelegate.h" static OFString *module = @"OFBlock";