summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordwight <dwight@10gen.com>2010-07-02 11:00:41 -0400
committerdwight <dwight@10gen.com>2010-07-02 11:00:41 -0400
commit897c5b1f5f506170c08d4f3de18b5aa09bc6f750 (patch)
tree1bb76b7fdbf1d8f4fb35ebaba543228b9e795ec2
parentf42dd671e49f836788c4d6f946fe012da51f9763 (diff)
parent9a847036926d8da49854962025990e6eb157e825 (diff)
downloadmongo-897c5b1f5f506170c08d4f3de18b5aa09bc6f750.tar.gz
Merge branch 'master' of github.com:mongodb/mongo
-rw-r--r--SConstruct2
-rw-r--r--bson/bson.h6
-rw-r--r--bson/bsonelement.h1
-rw-r--r--bson/bsoninlines.h2
4 files changed, 9 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 74ce5d73d69..f25733aa0dc 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1133,6 +1133,7 @@ clientEnv = env.Clone();
clientEnv.Append( CPPPATH=["../"] )
clientEnv.Prepend( LIBS=[ "mongoclient"] )
clientEnv.Prepend( LIBPATH=["."] )
+#clientEnv["CPPDEFINES"].remove( "MONGO_EXPOSE_MACROS" )
l = clientEnv[ "LIBS" ]
removeIfInList( l , "pcre" )
removeIfInList( l , "pcrecpp" )
@@ -1185,6 +1186,7 @@ clientTests += [ clientEnv.Program( "secondExample" , [ "client/examples/second.
clientTests += [ clientEnv.Program( "whereExample" , [ "client/examples/whereExample.cpp" ] ) ]
clientTests += [ clientEnv.Program( "authTest" , [ "client/examples/authTest.cpp" ] ) ]
clientTests += [ clientEnv.Program( "httpClientTest" , [ "client/examples/httpClientTest.cpp" ] ) ]
+# clientTests += [ clientEnv.Program( "bsondemo" , [ "bson/bsondemo/bsondemo.cpp" ] ) ] #TODO
# testing
test = testEnv.Program( "test" , Glob( "dbtests/*.cpp" ) )
diff --git a/bson/bson.h b/bson/bson.h
index 6426f97d6a1..d1328c767f1 100644
--- a/bson/bson.h
+++ b/bson/bson.h
@@ -63,9 +63,13 @@ namespace mongo {
}
#endif
#if !defined(uassert)
+ inline void uasserted(unsigned msgid, std::string) {
+ throw bson::assertion();
+ }
+
inline void uassert(unsigned msgid, std::string msg, bool expr) {
if( !expr )
- throw bson::assertion();
+ uasserted( msgid , msg );
}
inline void msgasserted(int msgid, const char *msg) {
throw bson::assertion();
diff --git a/bson/bsonelement.h b/bson/bsonelement.h
index 7ce0b81a0eb..19b7ef32e1e 100644
--- a/bson/bsonelement.h
+++ b/bson/bsonelement.h
@@ -18,6 +18,7 @@
#pragma once
#include <vector>
+#include <string.h>
namespace bson {
typedef mongo::BSONElement be;
diff --git a/bson/bsoninlines.h b/bson/bsoninlines.h
index f84470f5ef7..fd0b757b29c 100644
--- a/bson/bsoninlines.h
+++ b/bson/bsoninlines.h
@@ -273,7 +273,7 @@ namespace mongo {
massert( 10323 , "Invalid CodeWScope string size", totalSize >= strSizeWNull + 4 + 4 );
massert( 10324 , "Invalid CodeWScope string size",
strSizeWNull > 0 &&
- strSizeWNull - 1 == strnlen( codeWScopeCode(), strSizeWNull ) );
+ (strSizeWNull - 1) == strnlen( codeWScopeCode(), strSizeWNull ) );
massert( 10325 , "Invalid CodeWScope size", totalSize >= strSizeWNull + 4 + 4 + 4 );
int objSize = *( int * )( value() + 4 + 4 + strSizeWNull );
massert( 10326 , "Invalid CodeWScope object size", totalSize == 4 + 4 + strSizeWNull + objSize );