From 3f7b0e5500bb23581e3a5bc94feb9ecd624ae130 Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Sun, 3 Feb 2008 14:12:24 +0100 Subject: Objective-C layer: Add objcl_class_superclass. darcs-hash:31c261f7b04e09756c407599560a5ef5c3bc5856 --- Objective-C/libobjcl.h | 3 +++ Objective-C/libobjcl.m | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'Objective-C') diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h index 9008c9e..968cf14 100644 --- a/Objective-C/libobjcl.h +++ b/Objective-C/libobjcl.h @@ -71,6 +71,9 @@ objcl_query_arglist_info (void *receiver, const char * objcl_class_name (Class class); +Class +objcl_class_superclass (Class class); + const char * objcl_selector_name (SEL selector); diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index 3fc2300..5161a52 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -20,6 +20,7 @@ #import "libobjcl.h" #import "PyObjC/libffi_support.h" #import "PyObjC/objc_support.h" +#import "PyObjC/objc-runtime-compat.h" #import #include @@ -207,6 +208,17 @@ objcl_class_name (Class class) } +Class +objcl_class_superclass (Class class) +{ +#ifdef __NEXT_RUNTIME__ + return class_getSuperclass (class); +#else + return class_get_super_class (class); +#endif +} + + const char * objcl_selector_name (SEL selector) { -- cgit v1.2.3