forked from enlightenment/efl
eo2: make macro pass C++ compiler.
This commit is contained in:
parent
ef873b7b29
commit
d0153fabc1
|
@ -605,25 +605,26 @@ typedef struct _Eo2_Op_Call_Data
|
|||
|
||||
/* XXX: Essential, because we need to adjust objid for comp objects. */
|
||||
#define EO_FUNC_BODY(Name, Ret, Id, Func, DefRet) \
|
||||
Ret \
|
||||
Name(_Eo *obj, Eo *objid) \
|
||||
{ \
|
||||
Ret \
|
||||
Name(_Eo *obj, Eo *objid) \
|
||||
{ \
|
||||
typedef Ret (*__##Name##_func)(Eo *, void *obj_data); \
|
||||
Eo2_Op_Call_Data call; \
|
||||
if (!eo2_call_resolve(obj, Id(Name), &call)) return DefRet; \
|
||||
Ret (*func)(Eo *, void *obj_data) = call.func; \
|
||||
__##Name##_func func = (__##Name##_func) call.func; \
|
||||
return Func; \
|
||||
}
|
||||
}
|
||||
|
||||
#define EO_FUNC_BODYV(Name, Ret, Id, Func, DefRet, ...) \
|
||||
Ret \
|
||||
Name(_Eo *obj, Eo *objid, __VA_ARGS__) \
|
||||
{ \
|
||||
Ret \
|
||||
Name(_Eo *obj, Eo *objid, __VA_ARGS__) \
|
||||
{ \
|
||||
typedef Ret (*__##Name##_func)(Eo *, void *obj_data, __VA_ARGS__); \
|
||||
Eo2_Op_Call_Data call; \
|
||||
if (!eo2_call_resolve(obj, Id(Name), &call)) return DefRet; \
|
||||
Ret (*func)(Eo *, void *obj_data, __VA_ARGS__) = call.func; \
|
||||
__##Name##_func func = (__##Name##_func) call.func; \
|
||||
return Func; \
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
EAPI _Eo * eo2_do_start(Eo *obj_id);
|
||||
#define eo2_call_resolve(obj_id, op, call) eo2_call_resolve_internal(obj_id, NULL, op, call)
|
||||
|
@ -637,19 +638,19 @@ EAPI Eina_Bool eo2_call_resolve_internal(_Eo *obj, const Eo_Class *klass, Eo_Op
|
|||
#define eo2_a _Eo *obj, Eo *objid
|
||||
|
||||
#define eo2_do(objid, ...) \
|
||||
do \
|
||||
{ \
|
||||
do \
|
||||
{ \
|
||||
Eo *_objid_ = objid; \
|
||||
_Eo *_obj_ = eo2_do_start(_objid_); \
|
||||
do { __VA_ARGS__ ; } while (0); \
|
||||
eo2_do_end(_objid_); \
|
||||
} while (0)
|
||||
} while (0)
|
||||
|
||||
#define eo2_class_do(clsid, ...) \
|
||||
do \
|
||||
{ \
|
||||
do \
|
||||
{ \
|
||||
do { __VA_ARGS__ ; } while (0); \
|
||||
} while (0)
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @def eo_do
|
||||
|
|
Loading…
Reference in New Issue