Permalink
Browse files

enable BOOST_ENABLE_ASSERT_HANDLER in scons and fix boost assert func…

…tions

haven't removed from pch.h
  • Loading branch information...
1 parent b3bc0e8 commit 6fc718c18a1d8bf5b54b358af190314dd2a42c83 @erh erh committed Mar 19, 2012
Showing with 17 additions and 11 deletions.
  1. +1 −1 SConstruct
  2. +16 −10 src/mongo/util/assert_util.cpp
View
2 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" ):
View
26 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 );
+ }
+
+
+}
+

0 comments on commit 6fc718c

Please sign in to comment.