Eina refcount: Wrap EINA_REFCOUNT_UNREF with do {} while(0).

SVN revision: 59042
This commit is contained in:
Tom Hacohen 2011-04-29 18:54:29 +00:00
parent 74fb408eb1
commit 00c53f261b
1 changed files with 6 additions and 2 deletions

View File

@ -62,8 +62,12 @@ typedef int Eina_Refcount;
/** Used when removing a reference to an object. Free_Callback will automatically be called when necessary */
#define EINA_REFCOUNT_UNREF(Variable, Free_Callback) \
if (--((Variable)->__refcount) == 0) \
Free_Callback(Variable);
do \
{ \
if (--((Variable)->__refcount) == 0) \
Free_Callback(Variable); \
} \
while (0)
/** Get refcounting value */
#define EINA_REFCOUNT_GET(Variable) (Variable)->__refcount