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. 28
      include/tr/class.h

28
include/tr/class.h

@ -280,13 +280,13 @@
*
* \see TR_CALL
*/
#define TR_PARENTCALL(object,_iface,method,...) \
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); \
iface->method(object, ##__VA_ARGS__); \
#define TR_PARENTCALL(class, object,_iface,method,...) \
do { \
struct i_##_iface * iface; \
TR_class_ptr pc_class = TR_CLASS_BY_NAME(class); \
assert(TR_HAS_PARENT(pc_class)); \
_TR_CALL(pc_class->parent, _iface, method); \
iface->method(object, ##__VA_ARGS__); \
} while(0)
/*
@ -295,13 +295,13 @@
*
* \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); \
ret = iface->method(object, ##__VA_ARGS__); \
#define TR_PARENTRETCALL(class, object,_iface,method,ret,...) \
do { \
struct i_##_iface * iface; \
TR_class_ptr pc_class = TR_CLASS_BY_NAME(class); \
assert(TR_HAS_PARENT(pc_class)); \
_TR_CALL(pc_class->parent, _iface, method); \
ret = iface->method(object, ##__VA_ARGS__); \
} while(0)

Loading…
Cancel
Save