Skip to content

Commit 2d5d662

Browse files
committed
SERVER-8994: Boost 1.56 build fixes
1 parent 351523d commit 2d5d662

File tree

6 files changed

+32
-25
lines changed

6 files changed

+32
-25
lines changed

SConstruct

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,34 @@ def doConfigure(myenv):
15511551
if using_asan:
15521552
myenv['ENV']['ASAN_SYMBOLIZER_PATH'] = llvm_symbolizer
15531553

1554-
# When using msvc, check for VS 2013 Update 2+ so we can use new compiler flags
1554+
# When using msvc,
1555+
# check for min version of VS2013 for fixes in std::list::splice
1556+
# check for VS 2013 Update 2+ so we can use new compiler flags
15551557
if using_msvc():
1558+
haveVS2013OrLater = False
1559+
def CheckVS2013(context):
1560+
test_body = """
1561+
#if _MSC_VER < 1800
1562+
#error Old Version
1563+
#endif
1564+
int main(int argc, char* argv[]) {
1565+
return 0;
1566+
}
1567+
"""
1568+
context.Message('Checking for VS 2013 or Later... ')
1569+
ret = context.TryCompile(textwrap.dedent(test_body), ".cpp")
1570+
context.Result(ret)
1571+
return ret
1572+
conf = Configure(myenv, help=False, custom_tests = {
1573+
'CheckVS2013' : CheckVS2013,
1574+
})
1575+
haveVS2013 = conf.CheckVS2013()
1576+
conf.Finish()
1577+
1578+
if not haveVS2013:
1579+
print("Visual Studio 2013 RTM or later is required to compile MongoDB.")
1580+
Exit(1)
1581+
15561582
haveVS2013Update2OrLater = False
15571583
def CheckVS2013Update2(context):
15581584
test_body = """
@@ -1814,6 +1840,7 @@ def doConfigure(myenv):
18141840
# requires ports devel/libexecinfo to be installed
18151841
if freebsd or openbsd:
18161842
if not conf.CheckLib("execinfo"):
1843+
print("Cannot find libexecinfo, please install devel/libexecinfo.")
18171844
Exit(1)
18181845

18191846
# 'tcmalloc' needs to be the last library linked. Please, add new libraries before this

src/mongo/db/repl/repl_coordinator_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#pragma once
3030

3131
#include <boost/scoped_ptr.hpp>
32+
#include <boost/thread.hpp>
3233
#include <boost/thread/mutex.hpp>
3334
#include <boost/thread/condition_variable.hpp>
3435
#include <vector>

src/mongo/db/storage/mmap_v1/repair_database.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ namespace mongo {
373373

374374
Collection* tempCollection = NULL;
375375
{
376-
Client::Context tempContext(txn, ns, tempDatabase );
377376
WriteUnitOfWork wunit(txn);
378377
tempCollection = tempDatabase->createCollection(txn, ns, options, true, false);
379378
wunit.commit();
@@ -396,7 +395,6 @@ namespace mongo {
396395
indexes.push_back( desc->infoObj() );
397396
}
398397

399-
Client::Context tempContext(txn, ns, tempDatabase);
400398
Status status = indexer.init( indexes );
401399
if ( !status.isOK() )
402400
return status;
@@ -411,8 +409,6 @@ namespace mongo {
411409

412410
BSONObj doc = originalCollection->docFor( loc );
413411

414-
Client::Context tempContext(txn, ns, tempDatabase);
415-
416412
WriteUnitOfWork wunit(txn);
417413
StatusWith<DiskLoc> result = tempCollection->insertDocument(txn,
418414
doc,
@@ -430,7 +426,6 @@ namespace mongo {
430426
return status;
431427

432428
{
433-
Client::Context tempContext(txn, ns, tempDatabase);
434429
WriteUnitOfWork wunit(txn);
435430
indexer.commit();
436431
wunit.commit();

src/mongo/db/storage/record_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace mongo {
5252
/**
5353
* Returns true if this owns its own memory, and false otherwise
5454
*/
55-
bool isOwned() const { return _dataPtr; }
55+
bool isOwned() const { return _dataPtr.get(); }
5656

5757
// TODO eliminate double-copying
5858
BSONObj toBson() const { return isOwned() ? BSONObj(_data).getOwned() : BSONObj(_data); }

src/mongo/shell/linenoise_utf8.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*/
2929

3030
#include <boost/smart_ptr/scoped_array.hpp>
31+
#include <algorithm>
3132
#include <string.h>
3233

3334
namespace linenoise_utf8 {

src/mongo/stdx/list.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,6 @@
2828

2929
#pragma once
3030

31-
#ifdef _MSC_VER
32-
33-
// The MSVS STL implementation of std::list is not standards compliant, at least because it
34-
// invalidates iterators during std::list::splice operations.
35-
36-
#include <boost/container/list.hpp>
37-
38-
namespace mongo {
39-
namespace stdx {
40-
41-
using boost::container::list;
42-
43-
} // namespace stdx
44-
} // namespace mongo
45-
46-
#else
47-
4831
#include <list>
4932

5033
namespace mongo {
@@ -54,4 +37,4 @@ namespace stdx {
5437

5538
} // namespace stdx
5639
} // namespace mongo
57-
#endif
40+

0 commit comments

Comments
 (0)