diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-08 22:45:21 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-08 22:45:21 +0000 |
commit | 86871987528c71dfa0e666e663ed66f5eb776342 (patch) | |
tree | 3699f2d9d1ec95a88ce3a0eb0a9d891f11a563cf /pjlib | |
parent | e88c16ac16d93a586406bc5503d3110f264c5263 (diff) |
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
Diffstat (limited to 'pjlib')
-rw-r--r-- | pjlib/include/pj/assert.h | 3 |
1 files changed, 1 insertions, 2 deletions
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) |