зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1494671 - Make MOZ_AssertAssignmentTest() constexpr. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D7323 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
68a4b4feea
Коммит
10780a46ba
|
@ -11,6 +11,9 @@
|
|||
#ifndef bool
|
||||
#include <stdbool.h>
|
||||
#endif
|
||||
#define MOZ_CONSTEXPR
|
||||
#else // __cplusplus
|
||||
#define MOZ_CONSTEXPR constexpr
|
||||
#endif
|
||||
/*
|
||||
* Functions that are used as markers in Gecko code for static analysis. Their
|
||||
|
@ -37,7 +40,6 @@ static MOZ_ALWAYS_INLINE T* MOZ_KnownLive(T* ptr) { return ptr; }
|
|||
template <typename T>
|
||||
static MOZ_ALWAYS_INLINE T& MOZ_KnownLive(T& ref) { return ref; }
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -47,14 +49,10 @@ extern "C" {
|
|||
* Example:
|
||||
* MOZ_ASSERT(retVal = true);
|
||||
*/
|
||||
static MOZ_ALWAYS_INLINE bool MOZ_AssertAssignmentTest(bool exprResult) {
|
||||
static MOZ_ALWAYS_INLINE MOZ_CONSTEXPR bool MOZ_AssertAssignmentTest(bool exprResult) {
|
||||
return exprResult;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define MOZ_CHECK_ASSERT_ASSIGNMENT(expr) MOZ_AssertAssignmentTest(!!(expr))
|
||||
|
||||
#else
|
||||
|
|
Загрузка…
Ссылка в новой задаче