summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h3
-rw-r--r--Objective-C/libobjcl.m20
2 files changed, 23 insertions, 0 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index 35fd0c8..56ba2d7 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -43,6 +43,9 @@ objcl_invoke_with_types (int argc,
Class
objcl_find_class (const char *class_name);
+Class
+objcl_find_meta_class (const char *class_name);
+
SEL
objcl_find_selector (const char *selector_name);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index c13f252..6f09cfe 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -128,7 +128,27 @@ objcl_invoke_with_types (int argc,
Class
objcl_find_class (const char *class_name)
{
+#ifdef __NEXT_RUNTIME__
+ return objc_lookUpClass (class_name);
+#else
return NSClassFromString ([NSString stringWithUTF8String: class_name]);
+#endif
+}
+
+
+Class
+objcl_find_meta_class (const char *class_name)
+{
+#ifdef __NEXT_RUNTIME__
+ return objc_getMetaClass (class_name);
+#else
+ /* FIXME: Is this correct? */
+ Class class = objcl_find_class (class_name);
+ if (class == NULL || class == nil)
+ return NULL;
+ else
+ return class_get_meta_class (class);
+#endif
}