From 88945d4942374242a34391c3b7ce5e0d74dea728 Mon Sep 17 00:00:00 2001 From: tasn Date: Fri, 29 Apr 2011 18:54:29 +0000 Subject: [PATCH] Eina refcount: Wrap EINA_REFCOUNT_UNREF with do {} while(0). git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@59042 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/include/eina_refcount.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/include/eina_refcount.h b/src/include/eina_refcount.h index e36c0f8..788995b 100644 --- a/src/include/eina_refcount.h +++ b/src/include/eina_refcount.h @@ -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 -- 2.7.4