utils: Add ast_assert_return
authorGeorge Joseph <gjoseph@digium.com>
Fri, 13 Apr 2018 20:17:36 +0000 (14:17 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 17 Apr 2018 17:03:47 +0000 (11:03 -0600)
commitf7e7ce6ba248573b2a56625ad7dc4ae71d722430
treebddefb4caa3bad3a5bd4135d7d5f5d21da460d79
parent38dae51b788cd7f9f69c88573d6ce769c80f07f0
utils: Add ast_assert_return

Similar to pjproject's PJ_ASSERT_RETURN macro, this one will do the
following...

If the assert passes... NoOp

If the assert fails and AST_DEVMODE is defined, execute ast_assert()
then, if DO_CRASH isn't set, return from the calling function with
the supplied value.

If the assert fails and AST_DEVMODE is not defined, return from the
calling function with the supplied value.

The macro will execute a return without a value if one isn't suppled.

Change-Id: I0003844affeab550d5ff5bca7aa7cf8a559b873e
include/asterisk/utils.h