summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-19 18:56:15 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-19 18:56:15 +0100
commit7a58d0e28aecbf2044f543999909625cb99752d9 (patch)
tree130eff93c54ca79279263679cdbe8742330decef /Objective-C
parent9dde84278b34334a0689cd3eee0d098007996f81 (diff)
Make objcl_add_method capable of adding methods to registered classes.
darcs-hash:a29d29425ab1e91101b691224b5ee591b8237961
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h3
-rw-r--r--Objective-C/libobjcl.m8
2 files changed, 8 insertions, 3 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index b5cefce..b3e1a3a 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -203,7 +203,8 @@ objcl_add_method (Class class,
int argc,
const char *return_typespec,
const char *arg_typespecs[],
- const char *signature);
+ const char *signature,
+ int registered_p);
void
objcl_finalise_class (Class class);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index 8489891..1e70a37 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -807,14 +807,18 @@ objcl_add_method (Class class,
int argc,
const char *return_typespec,
const char *arg_typespecs[],
- const char *signature)
+ const char *signature,
+ int registered_p)
{
IMP imp;
imp = objcl_create_imp (callback, argc, return_typespec, arg_typespecs);
#ifdef __NEXT_RUNTIME__
- preclass_addMethod (class, method_name, imp, signature);
+ if (registered_p)
+ class_addMethod (class, method_name, imp, signature);
+ else
+ preclass_addMethod (class, method_name, imp, signature);
#else
NSString *class_name;
struct ObjCLMethod **methods;