diff options
author | Eliot Horowitz <eliot@10gen.com> | 2012-03-19 10:51:00 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2012-03-19 10:51:00 -0400 |
commit | 6fc718c18a1d8bf5b54b358af190314dd2a42c83 (patch) | |
tree | baddaa0e6cf25f9ae1ccc69e8601b1c621c25be5 | |
parent | b3bc0e8f8a10a1968046aa056f3b65c9917cb1a5 (diff) | |
download | mongo-6fc718c18a1d8bf5b54b358af190314dd2a42c83.tar.gz |
enable BOOST_ENABLE_ASSERT_HANDLER in scons and fix boost assert functions
haven't removed from pch.h
-rw-r--r-- | SConstruct | 2 | ||||
-rw-r--r-- | src/mongo/util/assert_util.cpp | 26 |
2 files changed, 17 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct index f0c8775fee3..ff7e3427cd7 100644 --- a/SConstruct +++ b/SConstruct @@ -332,7 +332,7 @@ if has_option( "libpath" ): if has_option( "cpppath" ): env["CPPPATH"] = [get_option( "cpppath" )] -env.Prepend( CPPDEFINES=[ "_SCONS" , "MONGO_EXPOSE_MACROS" ], +env.Prepend( CPPDEFINES=[ "_SCONS" , "MONGO_EXPOSE_MACROS" , "BOOST_ENABLE_ASSERT_HANDLER" ], CPPPATH=[ '$BUILD_DIR', "$BUILD_DIR/mongo" ] ) if has_option( "safeshell" ): diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index 40c7013cea4..8e6eb693a09 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -26,16 +26,6 @@ using namespace std; #include "../bson/bsonobjbuilder.h" -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; -#if defined(_DEBUG) - // for _DEBUG, abort so we notice for sure - ::abort(); -#endif - } -} - namespace mongo { AssertionCount assertionCount; @@ -246,3 +236,19 @@ namespace mongo { } + +namespace boost { + + void assertion_failed_msg(char const * expr, char const * msg, char const * function, char const * file, long line) { + mongo::log() << "boost assertion " << expr << ' ' << msg << ' ' << function << ' ' << file << ':' << line << endl; + } + + + void assertion_failed(char const * expr, char const * function, char const * file, long line) { + mongo::log() << "boost assertion failure " << expr << ' ' << function << ' ' << file << ':' << line << endl; + mongo::fassertFailed( 16108 ); + } + + +} + |