diff --git a/libs/ruamoko/rua_obj.c b/libs/ruamoko/rua_obj.c index 50ba97de1..f5e48ef39 100644 --- a/libs/ruamoko/rua_obj.c +++ b/libs/ruamoko/rua_obj.c @@ -1209,6 +1209,17 @@ rua___obj_exec_class (progs_t *pr) PR_GetString (pr, module->name)); } +static void +rua___obj_forward (progs_t *pr) +{ + probj_t *probj = pr->pr_objective_resources; + pr_id_t *receiver = &P_STRUCT (pr, pr_id_t, 0); + pr_sel_t *op = &P_STRUCT (pr, pr_sel_t, 1); + PR_RunError (pr, "seriously, dude, %s does not respond to %s", + PR_GetString (pr, object_get_class_name (probj, receiver)), + PR_GetString (pr, probj->selector_names[op->sel_id])); +} + static void rua_obj_error (progs_t *pr) { @@ -1928,6 +1939,7 @@ rua_PR_FindGlobal (progs_t *pr) static builtin_t obj_methods [] = { {"__obj_exec_class", rua___obj_exec_class, -1}, + {"__obj_forward", rua___obj_forward, -1}, {"obj_error", rua_obj_error, -1}, {"obj_verror", rua_obj_verror, -1}, diff --git a/ruamoko/include/runtime.h b/ruamoko/include/runtime.h index bbcd793ed..357416e26 100644 --- a/ruamoko/include/runtime.h +++ b/ruamoko/include/runtime.h @@ -38,6 +38,7 @@ typedef enum { YES ///< a true value } BOOL; +@extern void __obj_forward(id, SEL, ...); @extern void obj_error (id object, int code, string fmt, ...); @extern void obj_verror (id object, int code, string fmt, @va_list args); //obj_error_handler obj_set_error_handler (objc_error_handler func); diff --git a/ruamoko/lib/Makefile.am b/ruamoko/lib/Makefile.am index 8a66a3839..da1157a82 100644 --- a/ruamoko/lib/Makefile.am +++ b/ruamoko/lib/Makefile.am @@ -37,6 +37,7 @@ r_depfiles_remade= libr_a_SOURCES=\ cbuf.r cmd.r cvar.r hash.r msgbuf.r plist.r qfile.r qfs.r script.r \ sound.r string.r math.r types.r \ + obj_forward.r \ Object.r Protocol.r \ AutoreleasePool.r Array.r Array+Private.r Entity.r PropertyList.r Set.r libr_a_obj=$(libr_a_SOURCES:.r=.o) diff --git a/ruamoko/lib/Object.r b/ruamoko/lib/Object.r index d85a78064..07de4b7eb 100644 --- a/ruamoko/lib/Object.r +++ b/ruamoko/lib/Object.r @@ -1,6 +1,11 @@ #include #include +static void link__obj_forward (void) +{ + __obj_forward (nil, nil); +} + void *PR_FindGlobal (string name) = #0; //FIXME where? void __obj_exec_class (struct obj_module *msg) = #0; diff --git a/ruamoko/lib/obj_forward.r b/ruamoko/lib/obj_forward.r new file mode 100644 index 000000000..60ad819b5 --- /dev/null +++ b/ruamoko/lib/obj_forward.r @@ -0,0 +1,3 @@ +// __obj_foward is the only thing in this file so it can be readily replaced +// at link time +void __obj_forward(id object, SEL sel, ...) = #0;