diff --git a/include/tr/class.h b/include/tr/class.h index b23e1b6..647d2ab 100644 --- a/include/tr/class.h +++ b/include/tr/class.h @@ -262,6 +262,22 @@ iface->method(object, ##__VA_ARGS__); \ } while(0) +/* + * Like retcall but this calls the implementation of the direct parent + * class of this object. + * + * \see TR_RETCALL + */ +#define TR_PARENTRETCALL(object,_iface,method,ret,...) \ + do { \ + struct i_##_iface * iface; \ + TR_class_ptr pc_class = TR_GET_CLASS((object)); \ + assert(TR_HAS_PARENT(pc_class)); \ + _TR_CALL(pc_class->parent, _iface, method, ##__VA_ARGS__); \ + ret = iface->method(object, ##__VA_ARGS__); \ + } while(0) + + /** * Definition of the metadata structures and symbols used to * manage classe.