On Mon Oct 23, 2017 at 01:16:29AM +0200, Matthias Kilian wrote: > Hi, > > Unbreak the build of databases/mongodb after the update of devel/pcre > to 8.41. > > pcrecpp.h from pcre exposed std::string (and some other symbols) > to the global namespace by accident, which had been fixed in 8.41, > but obviously some parts of mongodb relies on this accidental > exposure.
Damn it! Global using namespace in a public header. > > Instead of prefixing every unqualified use of string with std::, I > choose to just pull in std::string in the affected files. > > And: yes, he upstream code is mixing std::string and string in some > of the files. I'm not enough a C++ guy to judge, but it looks a > little bit sloppy IMHO ;-) Best solution here, First, it's CPP only and second mongodb also does it this way for map, vector... > > ok? (anf if it's ok but I'm not around, someone feel free to commit it) My fault! I guess I didn't build everything. Thanks Matthias, ok rsadowski@ > > Ciao, > Kili > > Index: patches/patch-src_mongo_db_dbwebserver_cpp > =================================================================== > RCS file: patches/patch-src_mongo_db_dbwebserver_cpp > diff -N patches/patch-src_mongo_db_dbwebserver_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_mongo_db_dbwebserver_cpp 22 Oct 2017 23:03:14 > -0000 > @@ -0,0 +1,16 @@ > +$OpenBSD$ > + > +pcrecpp.h used to expose std::string, which is no longer the case > +starting with pcre-8.41. > + > +Index: src/mongo/db/dbwebserver.cpp > +--- src/mongo/db/dbwebserver.cpp.orig > ++++ src/mongo/db/dbwebserver.cpp > +@@ -67,6 +67,7 @@ > + namespace mongo { > + > + using std::map; > ++using std::string; > + using std::stringstream; > + using std::vector; > + > Index: patches/patch-src_mongo_db_matcher_expression_leaf_cpp > =================================================================== > RCS file: patches/patch-src_mongo_db_matcher_expression_leaf_cpp > diff -N patches/patch-src_mongo_db_matcher_expression_leaf_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_mongo_db_matcher_expression_leaf_cpp 22 Oct 2017 > 23:03:14 -0000 > @@ -0,0 +1,17 @@ > +$OpenBSD$ > + > +pcrecpp.h used to expose std::string, which is no longer the case > +starting with pcre-8.41. > + > +Index: src/mongo/db/matcher/expression_leaf.cpp > +--- src/mongo/db/matcher/expression_leaf.cpp.orig > ++++ src/mongo/db/matcher/expression_leaf.cpp > +@@ -45,6 +45,8 @@ > + > + namespace mongo { > + > ++using std::string; > ++ > + Status LeafMatchExpression::initPath(StringData path) { > + _path = path; > + return _elementPath.init(_path); > Index: patches/patch-src_mongo_db_repl_master_slave_cpp > =================================================================== > RCS file: patches/patch-src_mongo_db_repl_master_slave_cpp > diff -N patches/patch-src_mongo_db_repl_master_slave_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_mongo_db_repl_master_slave_cpp 22 Oct 2017 23:03:14 > -0000 > @@ -0,0 +1,16 @@ > +$OpenBSD$ > + > +pcrecpp.h used to expose std::string, which is no longer the case > +starting with pcre-8.41. > + > +Index: src/mongo/db/repl/master_slave.cpp > +--- src/mongo/db/repl/master_slave.cpp.orig > ++++ src/mongo/db/repl/master_slave.cpp > +@@ -77,6 +77,7 @@ using std::endl; > + using std::max; > + using std::min; > + using std::set; > ++using std::string; > + using std::stringstream; > + using std::unique_ptr; > + using std::vector; > Index: patches/patch-src_mongo_shell_bench_cpp > =================================================================== > RCS file: patches/patch-src_mongo_shell_bench_cpp > diff -N patches/patch-src_mongo_shell_bench_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_mongo_shell_bench_cpp 22 Oct 2017 23:03:14 -0000 > @@ -0,0 +1,16 @@ > +$OpenBSD$ > + > +pcrecpp.h used to expose std::string, which is no longer the case > +starting with pcre-8.41. > + > +Index: src/mongo/shell/bench.cpp > +--- src/mongo/shell/bench.cpp.orig > ++++ src/mongo/shell/bench.cpp > +@@ -79,6 +79,7 @@ using std::unique_ptr; > + using std::cout; > + using std::endl; > + using std::map; > ++using std::string; > + > + const std::map<OpType, std::string> opTypeName{{OpType::NONE, "none"}, > + {OpType::NOP, "nop"}, > Index: patches/patch-src_mongo_util_net_miniwebserver_cpp > =================================================================== > RCS file: patches/patch-src_mongo_util_net_miniwebserver_cpp > diff -N patches/patch-src_mongo_util_net_miniwebserver_cpp > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_mongo_util_net_miniwebserver_cpp 22 Oct 2017 > 23:03:14 -0000 > @@ -0,0 +1,16 @@ > +$OpenBSD$ > + > +pcrecpp.h used to expose std::string, which is no longer the case > +starting with pcre-8.41. > + > +Index: src/mongo/util/net/miniwebserver.cpp > +--- src/mongo/util/net/miniwebserver.cpp.orig > ++++ src/mongo/util/net/miniwebserver.cpp > +@@ -43,6 +43,7 @@ namespace mongo { > + > + using std::shared_ptr; > + using std::endl; > ++using std::string; > + using std::stringstream; > + using std::vector; > + >