<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8779">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">utils: Add ast_assert_else<br><br>Similar to pjproject's PJ_ASSERT_ macros, this one will do the<br>following...<br><br>If the assert passes... NoOp<br>If the assert fails and AST_DEVMODE is defined, execute ast_assert().<br>If the assert fails and AST_DEVMODE is not defined, execute the<br>supplied statement.<br><br>Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e<br>---<br>M include/asterisk/utils.h<br>1 file changed, 7 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/79/8779/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h<br>index 798caab..158d47e 100644<br>--- a/include/asterisk/utils.h<br>+++ b/include/asterisk/utils.h<br>@@ -859,6 +859,10 @@<br> <br> #ifdef AST_DEVMODE<br> #define ast_assert(a) _ast_assert(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__)<br>+#define ast_assert_else(a, _else) if (__builtin_expect(!(a), 1)) { \<br>+ ast_assert(a); \<br>+ _else; \<br>+}<br> static void force_inline _ast_assert(int condition, const char *condition_str, const char *file, int line, const char *function)<br> {<br> if (__builtin_expect(!condition, 1)) {<br>@@ -867,6 +871,9 @@<br> }<br> #else<br> #define ast_assert(a)<br>+#define ast_assert_else(a, _else) if (__builtin_expect(!(a), 1)) { \<br>+ _else; \<br>+}<br> #endif<br> <br> /*!<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8779">change 8779</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8779"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e </div>
<div style="display:none"> Gerrit-Change-Number: 8779 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>