+2010-10-10 Nicola Pero <nicola.pero@meta-innovation.com>
+
+ * objc-foreach.c: Include objc-private/common.h.
+ * objc/deprecated/METHOD_NULL.h: New file.
+ * objc/objc-api.h: Include deprecated/METHOD_NULL.h instead of
+ defining METHOD_NULL here.
+ * Makefile.in (OBJC_DEPRECATED_H): Added METHOD_NULL.h.
+ * Object.m ([+instancesRespondTo:]): Use (Method_t)0 instead of
+ METHOD_NULL.
+ ([-respondsTo:]): Same change.
+ * objc/objc-api.h (method_get_imp): Converted it into a normal
+ function so that we can hide the internals of struct objc_method.
+ * sendmsg.c (method_get_imp): Implemented.
+
2010-10-09 Nicola Pero <nicola.pero@meta-innovation.com>
* objc/objc-api.h (struct objc_super, Super, Super_t,
# User-visible header files containing deprecated APIs, from the
# objc/deprecated directory
OBJC_DEPRECATED_H = \
+ METHOD_NULL.h \
MetaClass.h \
Object.h \
STR.h \
+ (BOOL)instancesRespondTo:(SEL)aSel
{
- return class_get_instance_method(self, aSel)!=METHOD_NULL;
+ return class_get_instance_method(self, aSel) != (Method_t)0;
}
- (BOOL)respondsTo:(SEL)aSel
{
return ((object_is_instance(self)
?class_get_instance_method(self->isa, aSel)
- :class_get_class_method(self->isa, aSel))!=METHOD_NULL);
+ :class_get_class_method(self->isa, aSel)) != (Method_t)0);
}
+ (IMP)instanceMethodFor:(SEL)aSel
objc_set_enumeration_mutation_handler(), the two functions required
to handle mutations during a fast enumeration.
*/
-#include "objc/runtime.h" /* For objc_enumerationMutation() and objc_set_enumeration_mutation_handler() */
+#include "objc-private/common.h"
#include "objc-private/error.h" /* For _objc_abort() */
+#include "objc/runtime.h" /* For objc_enumerationMutation() and objc_set_enumeration_mutation_handler() */
/* The enumeration mutation handler currently in use. */
static void (*__objc_enumeration_mutation_handler)(id) = NULL;
--- /dev/null
+/* For functions which return Method_t */
+#define METHOD_NULL (Method_t)0
extern "C" {
#endif /* __cplusplus */
-/* For functions which return Method_t */
-#define METHOD_NULL (Method_t)0
- /* Boolean typedefs */
+#include "deprecated/METHOD_NULL.h"
+
/* Method descriptor returned by introspective Object methods.
This is really just the first part of the more complete objc_method
structure defined below and used internally by the runtime. */
const char* ivarname,
BOOL gcInvisible);
-static inline IMP
-method_get_imp(Method_t method)
-{
- return (method!=METHOD_NULL)?method->method_imp:(IMP)0;
-}
+objc_EXPORT IMP method_get_imp(Method_t method);
objc_EXPORT IMP get_imp (Class _class, SEL sel);
return res;
}
+/* Given a method, return its implementation. */
+IMP
+method_get_imp (Method_t method)
+{
+ return (method != (Method_t)0) ? method->method_imp : (IMP)0;
+}
+
/* Query if an object can respond to a selector, returns YES if the
object implements the selector otherwise NO. Does not check if the
method can be forwarded. */