summaryrefslogtreecommitdiff
path: root/libobjc
diff options
context:
space:
mode:
authornicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-24 15:32:25 +0000
committernicola <nicola@138bc75d-0d04-0410-961f-82ee72b054a4>2010-12-24 15:32:25 +0000
commitf2187fb09b2fb245fd7e968c0f8b47226c07fc46 (patch)
tree446ade8fb58c3ae9ed224c5430645dbb30deddb2 /libobjc
parentafd14b632516314fcc5392f234755b0d4010451e (diff)
downloadgcc-f2187fb09b2fb245fd7e968c0f8b47226c07fc46.tar.gz
In libobjc/:
2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com> * objc/runtime.h (class_conformsToProtocol, class_copyProtocolList): Updated documentation. In gcc/testsuite/: 2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com> * obj-c.dg/gnu-api-2-class.m: Test that class_conformsToProtocol() does not check the superclasses. * obj-c++.dg/gnu-api-2-class.mm: Same change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168226 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libobjc')
-rw-r--r--libobjc/ChangeLog5
-rw-r--r--libobjc/objc/runtime.h10
2 files changed, 13 insertions, 2 deletions
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index fbeaf3fa571..78112bdecfe 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-24 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc/runtime.h (class_conformsToProtocol,
+ class_copyProtocolList): Updated documentation.
+
2010-12-23 Nicola Pero <nicola.pero@meta-innovation.com>
* init.c (create_tree_of_subclasses_inherited_from): Updated
diff --git a/libobjc/objc/runtime.h b/libobjc/objc/runtime.h
index 8d380156e41..7ad46dcc6fd 100644
--- a/libobjc/objc/runtime.h
+++ b/libobjc/objc/runtime.h
@@ -768,7 +768,11 @@ objc_EXPORT Protocol **objc_copyProtocolList (unsigned int *numberOfReturnedProt
objc_EXPORT BOOL class_addProtocol (Class class_, Protocol *protocol);
/* Return YES if the class 'class_' conforms to Protocol 'protocol',
- and NO if not. */
+ and NO if not. This function does not check superclasses; if you
+ want to check for superclasses (in the way that [NSObject
+ +conformsToProtocol:] does) you need to iterate over the class
+ hierarchy using class_getSuperclass(), and call
+ class_conformsToProtocol() for each of them. */
objc_EXPORT BOOL class_conformsToProtocol (Class class_, Protocol *protocol);
/* Return all the protocols that the class conforms to. The return
@@ -777,7 +781,9 @@ objc_EXPORT BOOL class_conformsToProtocol (Class class_, Protocol *protocol);
class. It does not include protocols adopted by superclasses. The
list is terminated by NULL. Optionally, if you pass a non-NULL
'numberOfReturnedProtocols' pointer, the unsigned int that it
- points to will be filled with the number of protocols returned. */
+ points to will be filled with the number of protocols returned.
+ This function does not return protocols that superclasses conform
+ to. */
objc_EXPORT Protocol **class_copyProtocolList (Class class_, unsigned int *numberOfReturnedProtocols);
/* Return YES if protocol 'protocol' conforms to protocol