mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1127201 (attempt 2, part 3) - Remove the NS_ABORT_IF_FALSE macro. r=Waldo.
--HG-- extra : rebase_source : b0ff8671df31c6da4a2063ede611b3c554540950
This commit is contained in:
parent
6731149c55
commit
6bf8ed2521
@ -49,33 +49,6 @@ inline bool NS_warn_if_impl(bool aCondition, const char* aExpr,
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
|
||||||
* Abort the execution of the program if the expression evaluates to
|
|
||||||
* false.
|
|
||||||
*
|
|
||||||
* There is no status value returned from the macro.
|
|
||||||
*
|
|
||||||
* Note that the non-debug version of this macro does <b>not</b>
|
|
||||||
* evaluate the expression argument. Hence side effect statements
|
|
||||||
* as arguments to the macro will yield improper execution in a
|
|
||||||
* non-debug build. For example:
|
|
||||||
*
|
|
||||||
* NS_ABORT_IF_FALSE(0 == foo++, "yikes foo should be zero");
|
|
||||||
*
|
|
||||||
* Note also that the non-debug version of this macro does <b>not</b>
|
|
||||||
* evaluate the message argument.
|
|
||||||
*/
|
|
||||||
#ifdef DEBUG
|
|
||||||
#define NS_ABORT_IF_FALSE(_expr, _msg) \
|
|
||||||
do { \
|
|
||||||
if (!(_expr)) { \
|
|
||||||
NS_DebugBreak(NS_DEBUG_ABORT, _msg, #_expr, __FILE__, __LINE__); \
|
|
||||||
} \
|
|
||||||
} while(0)
|
|
||||||
#else
|
|
||||||
#define NS_ABORT_IF_FALSE(_expr, _msg) do { /* nothing */ } while(0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warn if a given condition is false.
|
* Warn if a given condition is false.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user