summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-03-19 10:51:00 -0400
committerEliot Horowitz <eliot@10gen.com>2012-03-19 10:51:00 -0400
commit6fc718c18a1d8bf5b54b358af190314dd2a42c83 (patch)
treebaddaa0e6cf25f9ae1ccc69e8601b1c621c25be5
parentb3bc0e8f8a10a1968046aa056f3b65c9917cb1a5 (diff)
downloadmongo-6fc718c18a1d8bf5b54b358af190314dd2a42c83.tar.gz
enable BOOST_ENABLE_ASSERT_HANDLER in scons and fix boost assert functions
haven't removed from pch.h
-rw-r--r--SConstruct2
-rw-r--r--src/mongo/util/assert_util.cpp26
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 );
+ }
+
+
+}
+