From 86871987528c71dfa0e666e663ed66f5eb776342 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 8 Feb 2006 22:45:21 +0000 Subject: Changed PJ_ASSERT_RETURN implementation, to prevent expr from being evaluated twice git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@161 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/include/pj/assert.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'pjlib') diff --git a/pjlib/include/pj/assert.h b/pjlib/include/pj/assert.h index d6cb5163..1184ae3b 100644 --- a/pjlib/include/pj/assert.h +++ b/pjlib/include/pj/assert.h @@ -60,8 +60,7 @@ #if defined(PJ_ENABLE_EXTRA_CHECK) && PJ_ENABLE_EXTRA_CHECK != 0 # define PJ_ASSERT_RETURN(expr,retval) \ do { \ - pj_assert(expr); \ - if (!(expr)) return retval; \ + if (!(expr)) { pj_assert(0); return retval; } \ } while (0) #else # define PJ_ASSERT_RETURN(expr,retval) pj_assert(expr) -- cgit v1.2.3