diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-05-26 14:34:55 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-06-04 12:29:34 -0400 |
commit | b3d48bd2c0ebba67f32aca2679077543378b20ab (patch) | |
tree | fe8ce422296bea0eb5e3b63efaa08d327dc9ee86 /src/mongo/util/assert_util.h | |
parent | dd7c8316e870418efb2ceda8b9c490d7e92e47ee (diff) | |
download | mongo-b3d48bd2c0ebba67f32aca2679077543378b20ab.tar.gz |
SERVER-18007 support non-default constructible types in StatusWith
Diffstat (limited to 'src/mongo/util/assert_util.h')
-rw-r--r-- | src/mongo/util/assert_util.h | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h index 5fd4d56aa2e..b45585abd8d 100644 --- a/src/mongo/util/assert_util.h +++ b/src/mongo/util/assert_util.h @@ -40,6 +40,10 @@ #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/debug_util.h" +#define MONGO_INCLUDE_INVARIANT_H_WHITELISTED +#include "mongo/util/invariant.h" +#undef MONGO_INCLUDE_INVARIANT_H_WHITELISTED + namespace mongo { enum CommonErrorCodes { @@ -175,7 +179,6 @@ namespace mongo { }; MONGO_COMPILER_NORETURN void verifyFailed(const char* expr, const char* file, unsigned line); - MONGO_COMPILER_NORETURN void invariantFailed(const char* expr, const char* file, unsigned line); MONGO_COMPILER_NORETURN void invariantOKFailed(const char* expr, const Status& status, const char *file, unsigned line); void wasserted(const char* expr, const char* file, unsigned line); MONGO_COMPILER_NORETURN void fassertFailed( int msgid ); @@ -296,11 +299,6 @@ namespace mongo { } \ } while (false) -#define MONGO_invariant(_Expression) do { \ - if (MONGO_unlikely(!(_Expression))) { \ - ::mongo::invariantFailed(#_Expression, __FILE__, __LINE__); \ - } \ - } while (false) #define MONGO_invariantOK(expression) do { \ const ::mongo::Status _invariantOK_status = expression; \ @@ -309,14 +307,7 @@ namespace mongo { } \ } while (false) - /* dassert is 'debug assert' -- might want to turn off for production as these - could be slow. - */ -#define MONGO_dassert(x) if (kDebugBuild) invariant(x) - -#define dassert MONGO_dassert #define verify(expression) MONGO_verify(expression) -#define invariant MONGO_invariant #define invariantOK MONGO_invariantOK #define uassert MONGO_uassert #define wassert MONGO_wassert |