0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

SERVER-8994: Boost 1.55 MacOS X fixes

1. Move swap from std to mongo namespace. Fixed C++ build on 10.9 with
XCode 5.1
2. Add check to see if no-null-conversion needs to be enabled for C++
build on 10.8 with Xcode 4.2
This commit is contained in:
Mark Benvenuto 2014-06-12 16:49:57 -04:00
parent 87d09bc9cf
commit a2d69514a4
2 changed files with 25 additions and 6 deletions

View File

@ -1165,6 +1165,31 @@ def doConfigure(myenv):
# primary mongo sources as well.
AddToCCFLAGSIfSupported(myenv, "-Wno-unused-const-variable")
# Check if we need to disable null-conversion warnings
if using_clang():
def CheckNullConversion(context):
test_body = """
#include <boost/shared_ptr.hpp>
struct TestType { int value; bool boolValue; };
bool foo() {
boost::shared_ptr<TestType> sp(new TestType);
return NULL != sp;
}
"""
context.Message('Checking if implicit boost::shared_ptr null conversion is supported... ')
ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
context.Result(ret)
return ret
conf = Configure(myenv, help=False, custom_tests = {
'CheckNullConversion' : CheckNullConversion,
})
if conf.CheckNullConversion() == False:
env.Append( CCFLAGS="-Wno-null-conversion" )
conf.Finish()
# This needs to happen before we check for libc++, since it affects whether libc++ is available.
if darwin and has_option('osx-version-min'):
min_version = get_option('osx-version-min')

View File

@ -544,16 +544,10 @@ namespace mongo {
std::vector<Value> _array;
};
}
namespace std {
template<>
inline void swap(mongo::Document& lhs, mongo::Document& rhs) { lhs.swap(rhs); }
}
/* ======================= INLINED IMPLEMENTATIONS ========================== */
namespace mongo {
inline FieldIterator Document::fieldIterator() const {
return FieldIterator(*this);
}