diff options
-rw-r--r-- | src/mongo/db/repl/rs.cpp | 7 | ||||
-rw-r--r-- | src/mongo/pch.h | 5 | ||||
-rw-r--r-- | src/mongo/server.h | 10 | ||||
-rw-r--r-- | src/mongo/util/assert_util.cpp | 8 |
4 files changed, 23 insertions, 7 deletions
diff --git a/src/mongo/db/repl/rs.cpp b/src/mongo/db/repl/rs.cpp index fff5d72bcc0..95833717e99 100644 --- a/src/mongo/db/repl/rs.cpp +++ b/src/mongo/db/repl/rs.cpp @@ -769,10 +769,3 @@ namespace mongo { } -namespace boost { - - void assertion_failed(char const * expr, char const * function, char const * file, long line) { - mongo::log() << "boost assertion failure " << expr << ' ' << function << ' ' << file << ' ' << line << endl; - } - -} diff --git a/src/mongo/pch.h b/src/mongo/pch.h index ecb98e17146..4a3000ed1eb 100644 --- a/src/mongo/pch.h +++ b/src/mongo/pch.h @@ -22,6 +22,11 @@ #define MONGO_PCH_H #if defined(MONGO_EXPOSE_MACROS) +# if defined(_DEBUG) +# define BOOST_ENABLE_ASSERT_HANDLER 1 +# else +# define BOOST_DISABLE_ASSERTS 1 +# endif # define JS_C_STRINGS_ARE_UTF8 # undef SUPPORT_UCP # define SUPPORT_UCP diff --git a/src/mongo/server.h b/src/mongo/server.h index d9a711ef780..2afa6356461 100644 --- a/src/mongo/server.h +++ b/src/mongo/server.h @@ -8,6 +8,16 @@ #pragma once +#if !defined(MONGO_EXPOSE_MACROS) +# error this file is for mongo server programs not client lib +#endif + +#if defined(_DEBUG) +# define BOOST_ENABLE_ASSERT_HANDLER 1 +#else +# define BOOST_DISABLE_ASSERTS 1 +#endif + #include <map> #include <vector> #include <set> diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index f4ce9ba66cf..9018c10e018 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -30,6 +30,14 @@ using namespace std; //#include "../bson/bson.h" #include "../db/jsobj.h" +#if defined(_DEBUG) +void boost::assertion_failed(char const * expr, char const * function, char const * file, long line) { + mongo::log() << "boost assertion failure " << expr << ' ' << function << ' ' << file << ' ' << line << endl; + // for _DEBUG, abort so we notice for sure + ::abort(); +} +#endif + namespace mongo { AssertionCount assertionCount; |