eo2: add macros for functions with no argument

This commit is contained in:
Jérémy Zurcher 2013-07-09 17:43:46 +02:00 committed by Tom Hacohen
parent 9e042c0686
commit 73f1d2a09e
1 changed files with 14 additions and 3 deletions

View File

@ -594,11 +594,22 @@ EAPI Eina_Bool eo_shutdown(void);
typedef struct _Eo_Internal _Eo;
#define EO_FUNC_CALL(...) func(objid, obj_data, __VA_ARGS__)
#define EO_FUNC_CALL() func(objid, obj_data)
#define EO_FUNC_CALLV(...) func(objid, obj_data, __VA_ARGS__)
/* XXX: Essential, because we need to adjust objid for comp objects. */
#define EO_FUNC_BODY(Name, Ret, Id, Func, DefRet, ...) \
EAPI Ret \
#define EO_FUNC_BODY(Name, Ret, Id, Func, DefRet) \
Ret \
Name(_Eo *obj, Eo *objid) \
{ \
Ret (*func)(Eo *, void *obj_data) = eo2_func_get(obj, Id(Name)); \
if (!func) return DefRet; \
void *obj_data = eo2_data_scope_get(obj); \
return Func; \
}
#define EO_FUNC_BODYV(Name, Ret, Id, Func, DefRet, ...) \
Ret \
Name(_Eo *obj, Eo *objid, __VA_ARGS__) \
{ \
Ret (*func)(Eo *, void *obj_data, __VA_ARGS__) = eo2_func_get(obj, Id(Name)); \