From d28be8fbe8ab2b8610debbc87f608977f53ab6ef Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Mon, 11 Aug 2014 20:44:50 +0100 Subject: [PATCH] fix PARENTCALL. We need the current class context to find the right parent. --- include/tr/class.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/tr/class.h b/include/tr/class.h index db68e1a..f7d70c0 100644 --- a/include/tr/class.h +++ b/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)