summaryrefslogtreecommitdiff
path: root/src/mongo/util/assert_util.h
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2016-05-09 16:27:06 -0400
committerAndy Schwerin <schwerin@mongodb.com>2016-05-17 11:11:57 -0400
commit76de5323b88080f852ca4c2f42593502d26c5620 (patch)
treeed2757f12d12670a25f29529c78b327bb308263d /src/mongo/util/assert_util.h
parent73a042328a539b51b3bf35efc16ec3245381dc40 (diff)
downloadmongo-76de5323b88080f852ca4c2f42593502d26c5620.tar.gz
SERVER-24104 Replace stdx::duration with mongo::Duration.
The mongo::Duration type does overflow checking on casts and arithmetic. This patch also moves DESTRUCTOR_GUARD out of assert_util.h into destructor_guard.h in order to break an include cycle with duration.h.
Diffstat (limited to 'src/mongo/util/assert_util.h')
-rw-r--r--src/mongo/util/assert_util.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/mongo/util/assert_util.h b/src/mongo/util/assert_util.h
index 82369810174..1d72c045764 100644
--- a/src/mongo/util/assert_util.h
+++ b/src/mongo/util/assert_util.h
@@ -31,10 +31,8 @@
#include <string>
#include "mongo/base/status.h" // NOTE: This is safe as utils depend on base
+#include "mongo/base/status_with.h"
#include "mongo/platform/compiler.h"
-#include "mongo/logger/log_severity.h"
-#include "mongo/logger/logger.h"
-#include "mongo/logger/logstream_builder.h"
#include "mongo/util/concurrency/thread_name.h"
#include "mongo/util/debug_util.h"
@@ -380,23 +378,6 @@ Status exceptionToStatus();
msgasserted(14044, std::string("unknown exception") + msg); \
}
-#define DESTRUCTOR_GUARD MONGO_DESTRUCTOR_GUARD
-#define MONGO_DESTRUCTOR_GUARD(expression) \
- try { \
- expression; \
- } catch (const std::exception& e) { \
- ::mongo::logger::LogstreamBuilder(::mongo::logger::globalLogDomain(), \
- ::mongo::getThreadName(), \
- ::mongo::logger::LogSeverity::Log()) \
- << "caught exception (" << e.what() << ") in destructor (" << __FUNCTION__ << ")" \
- << std::endl; \
- } catch (...) { \
- ::mongo::logger::LogstreamBuilder(::mongo::logger::globalLogDomain(), \
- ::mongo::getThreadName(), \
- ::mongo::logger::LogSeverity::Log()) \
- << "caught unknown exception in destructor (" << __FUNCTION__ << ")" << std::endl; \
- }
-
/**
* The purpose of this macro is to instruct the compiler that a line of code will never be reached.
*