Browse Source

fix PARENTCALL. We need the current class context to find the right parent.

1.0.2
Georg Hopp 11 years ago
parent
commit
d28be8fbe8
  1. 8
      include/tr/class.h

8
include/tr/class.h

@ -280,10 +280,10 @@
* *
* \see TR_CALL * \see TR_CALL
*/ */
#define TR_PARENTCALL(object,_iface,method,...) \
#define TR_PARENTCALL(class, object,_iface,method,...) \
do { \ do { \
struct i_##_iface * iface; \ struct i_##_iface * iface; \
TR_class_ptr pc_class = TR_GET_CLASS((object)); \
TR_class_ptr pc_class = TR_CLASS_BY_NAME(class); \
assert(TR_HAS_PARENT(pc_class)); \ assert(TR_HAS_PARENT(pc_class)); \
_TR_CALL(pc_class->parent, _iface, method); \ _TR_CALL(pc_class->parent, _iface, method); \
iface->method(object, ##__VA_ARGS__); \ iface->method(object, ##__VA_ARGS__); \
@ -295,10 +295,10 @@
* *
* \see TR_RETCALL * \see TR_RETCALL
*/ */
#define TR_PARENTRETCALL(object,_iface,method,ret,...) \
#define TR_PARENTRETCALL(class, object,_iface,method,ret,...) \
do { \ do { \
struct i_##_iface * iface; \ struct i_##_iface * iface; \
TR_class_ptr pc_class = TR_GET_CLASS((object)); \
TR_class_ptr pc_class = TR_CLASS_BY_NAME(class); \
assert(TR_HAS_PARENT(pc_class)); \ assert(TR_HAS_PARENT(pc_class)); \
_TR_CALL(pc_class->parent, _iface, method); \ _TR_CALL(pc_class->parent, _iface, method); \
ret = iface->method(object, ##__VA_ARGS__); \ ret = iface->method(object, ##__VA_ARGS__); \

Loading…
Cancel
Save