From: Francis Dupont Date: Wed, 30 Nov 2016 14:39:42 +0000 (+0100) Subject: [5066] Enforced C++11 following #4631 discussion X-Git-Tag: trac5077_base~6^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=818d58d73c27092563a244ececddcdd448e2cf70;p=thirdparty%2Fkea.git [5066] Enforced C++11 following #4631 discussion --- diff --git a/configure.ac b/configure.ac index c6918d1a1e..a2ef3fadc0 100644 --- a/configure.ac +++ b/configure.ac @@ -117,6 +117,48 @@ AC_CHECK_DECL([__clang__], [CLANGPP="yes"], [CLANGPP="no"]) # USE_CLANGPP is no longer used, keep it by summetry with USE_GXX? AM_CONDITIONAL(USE_CLANGPP, test "X${CLANGPP}" = "Xyes") +# Check for std::unique_ptr and aggregate initialization (aka C++11) support +retried=0 +CXX_SAVED=$CXX +for retry in "--std=c++11" "--std=c++0x" "--std=c++1x"; do + AC_MSG_CHECKING(std::unique_ptr support) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [std::unique_ptr a;])], + [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + if test $retried -eq 0; then + AC_MSG_WARN([unsupported C++11 feature]) + fi + if test $retried -ge 3; then + AC_MSG_ERROR([std::unique_ptr (a C++11 feature) is not supported]) + fi + AC_MSG_NOTICE([retrying by adding $retry to $CXX]) + retried=`expr $retried + 1` + CXX="$CXX_SAVED $retry" + continue]) + + AC_MSG_CHECKING(aggregate initialization support) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [std::vector foo = { 1, 2, 3};])], + [AC_MSG_RESULT([yes]) + break], + [AC_MSG_RESULT([no]) + if test $retried -eq 0; then + AC_MSG_WARN([unsupported C++11 feature]) + fi + if test $retried -ge 3; then + AC_MSG_ERROR([aggregate initialization (a C++11 feature) is not supported]) + fi + AC_MSG_NOTICE([retrying by adding $retry to $CXX]) + retried=`expr $retried + 1` + CXX="$CXX_SAVED $retry" + continue]) +done + dnl Determine if we are using GNU sed GNU_SED=no $SED --version 2> /dev/null | grep GNU > /dev/null 2>&1 diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc index 0e932b2505..54bcc91a1b 100644 --- a/src/lib/dns/master_loader.cc +++ b/src/lib/dns/master_loader.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -25,7 +27,7 @@ #include // for sscanf() using std::string; -using std::auto_ptr; +using std::unique_ptr; using std::vector; using std::pair; using boost::algorithm::iequals; @@ -1034,10 +1036,9 @@ MasterLoader::MasterLoader(std::istream& stream, if (add_callback.empty()) { isc_throw(isc::InvalidParameter, "Empty add RR callback"); } - auto_ptr impl(new MasterLoaderImpl("", zone_origin, - zone_class, callbacks, - add_callback, - options)); + unique_ptr + impl(new MasterLoaderImpl("", zone_origin, zone_class, + callbacks, add_callback, options)); impl->pushStreamSource(stream); impl_ = impl.release(); } diff --git a/src/lib/dns/rdata.cc b/src/lib/dns/rdata.cc index d2ce5b8ead..357ccc7cdf 100644 --- a/src/lib/dns/rdata.cc +++ b/src/lib/dns/rdata.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include @@ -278,10 +280,10 @@ Generic::constructFromLexer(MasterLexer& lexer) { Generic::Generic(const std::string& rdata_string) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the GenericImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(rdata_string); diff --git a/src/lib/dns/rdata/any_255/tsig_250.cc b/src/lib/dns/rdata/any_255/tsig_250.cc index d8e7224e4c..a80d742d09 100644 --- a/src/lib/dns/rdata/any_255/tsig_250.cc +++ b/src/lib/dns/rdata/any_255/tsig_250.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -208,10 +210,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { /// /// \param tsig_str A string containing the RDATA to be created TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the TSIGImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(tsig_str); diff --git a/src/lib/dns/rdata/generic/caa_257.cc b/src/lib/dns/rdata/generic/caa_257.cc index 378c1cac07..7f8b455687 100644 --- a/src/lib/dns/rdata/generic/caa_257.cc +++ b/src/lib/dns/rdata/generic/caa_257.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -95,10 +95,10 @@ CAA::constructFromLexer(MasterLexer& lexer) { CAA::CAA(const string& caa_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the CAAImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(caa_str); diff --git a/src/lib/dns/rdata/generic/dnskey_48.cc b/src/lib/dns/rdata/generic/dnskey_48.cc index 3bdb93ee78..7bea847427 100644 --- a/src/lib/dns/rdata/generic/dnskey_48.cc +++ b/src/lib/dns/rdata/generic/dnskey_48.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -70,10 +72,10 @@ struct DNSKEYImpl { DNSKEY::DNSKEY(const std::string& dnskey_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the DNSKEYImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(dnskey_str); diff --git a/src/lib/dns/rdata/generic/nsec3_50.cc b/src/lib/dns/rdata/generic/nsec3_50.cc index e6b9208094..e99c109807 100644 --- a/src/lib/dns/rdata/generic/nsec3_50.cc +++ b/src/lib/dns/rdata/generic/nsec3_50.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -79,10 +81,10 @@ struct NSEC3Impl { NSEC3::NSEC3(const std::string& nsec3_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3Impl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(nsec3_str); diff --git a/src/lib/dns/rdata/generic/nsec3param_51.cc b/src/lib/dns/rdata/generic/nsec3param_51.cc index 444701a374..2d28a69885 100644 --- a/src/lib/dns/rdata/generic/nsec3param_51.cc +++ b/src/lib/dns/rdata/generic/nsec3param_51.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include @@ -57,10 +59,10 @@ struct NSEC3PARAMImpl { NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3PARAMImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(nsec3param_str); diff --git a/src/lib/dns/rdata/generic/opt_41.cc b/src/lib/dns/rdata/generic/opt_41.cc index 460b3666ae..40cb1c73ae 100644 --- a/src/lib/dns/rdata/generic/opt_41.cc +++ b/src/lib/dns/rdata/generic/opt_41.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -86,7 +86,7 @@ OPT::OPT(MasterLexer&, const Name*, OPT::OPT(InputBuffer& buffer, size_t rdata_len) : impl_(NULL) { - std::auto_ptr impl_ptr(new OPTImpl); + std::unique_ptr impl_ptr(new OPTImpl); while (true) { if (rdata_len == 0) { diff --git a/src/lib/dns/rdata/generic/rrsig_46.cc b/src/lib/dns/rdata/generic/rrsig_46.cc index 8565392996..de92c67c34 100644 --- a/src/lib/dns/rdata/generic/rrsig_46.cc +++ b/src/lib/dns/rdata/generic/rrsig_46.cc @@ -1,9 +1,11 @@ -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -137,10 +139,10 @@ RRSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { RRSIG::RRSIG(const std::string& rrsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the RRSIGImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream iss(rrsig_str); diff --git a/src/lib/dns/rdata/generic/sshfp_44.cc b/src/lib/dns/rdata/generic/sshfp_44.cc index 5aa7bdd445..a08a17fcb0 100644 --- a/src/lib/dns/rdata/generic/sshfp_44.cc +++ b/src/lib/dns/rdata/generic/sshfp_44.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -104,10 +104,10 @@ SSHFP::constructFromLexer(MasterLexer& lexer) { SSHFP::SSHFP(const string& sshfp_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the SSHFPImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(sshfp_str); diff --git a/src/lib/dns/rdataclass.cc b/src/lib/dns/rdataclass.cc index 4a9bf3662e..b5c6107b85 100644 --- a/src/lib/dns/rdataclass.cc +++ b/src/lib/dns/rdataclass.cc @@ -5,12 +5,14 @@ /////////////// /////////////// -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -217,10 +219,10 @@ TSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { /// /// \param tsig_str A string containing the RDATA to be created TSIG::TSIG(const std::string& tsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the TSIGImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(tsig_str); @@ -843,7 +845,7 @@ AFSDB::getSubtype() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2014-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -942,10 +944,10 @@ CAA::constructFromLexer(MasterLexer& lexer) { CAA::CAA(const string& caa_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the CAAImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(caa_str); @@ -1527,12 +1529,14 @@ DNAME::getDname() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -1601,10 +1605,10 @@ struct DNSKEYImpl { DNSKEY::DNSKEY(const std::string& dnskey_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the DNSKEYImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(dnskey_str); @@ -2816,12 +2820,14 @@ NS::getNSName() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -2899,10 +2905,10 @@ struct NSEC3Impl { NSEC3::NSEC3(const std::string& nsec3_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3Impl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(nsec3_str); @@ -3161,12 +3167,14 @@ NSEC3::getNext() const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include @@ -3222,10 +3230,10 @@ struct NSEC3PARAMImpl { NSEC3PARAM::NSEC3PARAM(const std::string& nsec3param_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the NSEC3PARAMImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(nsec3param_str); @@ -3613,7 +3621,7 @@ NSEC::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -3703,7 +3711,7 @@ OPT::OPT(MasterLexer&, const Name*, OPT::OPT(InputBuffer& buffer, size_t rdata_len) : impl_(NULL) { - std::auto_ptr impl_ptr(new OPTImpl); + std::unique_ptr impl_ptr(new OPTImpl); while (true) { if (rdata_len == 0) { @@ -4125,12 +4133,14 @@ RP::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2010-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2010-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include #include @@ -4266,10 +4276,10 @@ RRSIG::constructFromLexer(MasterLexer& lexer, const Name* origin) { RRSIG::RRSIG(const std::string& rrsig_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the RRSIGImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream iss(rrsig_str); @@ -4816,7 +4826,7 @@ SPF::compare(const Rdata& other) const { } // end of namespace "rdata" } // end of namespace "dns" } // end of namespace "isc" -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -4924,10 +4934,10 @@ SSHFP::constructFromLexer(MasterLexer& lexer) { SSHFP::SSHFP(const string& sshfp_str) : impl_(NULL) { - // We use auto_ptr here because if there is an exception in this + // We use unique_ptr here because if there is an exception in this // constructor, the destructor is not called and there could be a // leak of the SSHFPImpl that constructFromLexer() returns. - std::auto_ptr impl_ptr(NULL); + std::unique_ptr impl_ptr; try { std::istringstream ss(sshfp_str); diff --git a/src/lib/log/Makefile.am b/src/lib/log/Makefile.am index e1185cd1f0..ebf531c0ad 100644 --- a/src/lib/log/Makefile.am +++ b/src/lib/log/Makefile.am @@ -40,7 +40,7 @@ EXTRA_DIST += log_messages.mes # KEA_CXXFLAGS) libkea_log_la_CXXFLAGS = $(AM_CXXFLAGS) if USE_GXX -libkea_log_la_CXXFLAGS += -Wno-unused-parameter +libkea_log_la_CXXFLAGS += -Wno-unused-parameter -Wno-deprecated-declarations endif libkea_log_la_CPPFLAGS = $(AM_CPPFLAGS) $(LOG4CPLUS_INCLUDES) libkea_log_la_LIBADD = $(top_builddir)/src/lib/log/interprocess/libkea-log_interprocess.la diff --git a/src/lib/util/threads/sync.cc b/src/lib/util/threads/sync.cc index 50c7bf88ef..06463f95e9 100644 --- a/src/lib/util/threads/sync.cc +++ b/src/lib/util/threads/sync.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -17,7 +17,7 @@ #include -using std::auto_ptr; +using std::unique_ptr; namespace isc { namespace util { @@ -82,7 +82,7 @@ Mutex::Mutex() : isc_throw(isc::InvalidOperation, std::strerror(result)); } - auto_ptr impl(new Impl); + unique_ptr impl(new Impl); result = pthread_mutex_init(&impl->mutex, &attributes); switch (result) { case 0: // All 0K diff --git a/src/lib/util/threads/sync.h b/src/lib/util/threads/sync.h index 6306078be8..15e78fcb6e 100644 --- a/src/lib/util/threads/sync.h +++ b/src/lib/util/threads/sync.h @@ -1,4 +1,4 @@ -// Copyright (C) 2012-2015 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2012-2016 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -66,7 +66,7 @@ public: /// is destroyed. /// /// If you create the locker on the stack or using some other "garbage - /// collecting" mechanism (auto_ptr, for example), it ensures exception + /// collecting" mechanism (unique_ptr, for example), it ensures exception /// safety with regards to the mutex - it'll get released on the exit /// of function no matter by what means. class Locker : boost::noncopyable { diff --git a/src/lib/util/threads/thread.cc b/src/lib/util/threads/thread.cc index 2154af5539..54f67da6c8 100644 --- a/src/lib/util/threads/thread.cc +++ b/src/lib/util/threads/thread.cc @@ -4,6 +4,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. +#include + #include #include @@ -20,7 +22,7 @@ using std::string; using std::exception; -using std::auto_ptr; +using std::unique_ptr; using boost::scoped_ptr; namespace isc { @@ -123,7 +125,7 @@ public: Thread::Thread(const boost::function& main) : impl_(NULL) { - auto_ptr impl(new Impl(main)); + unique_ptr impl(new Impl(main)); Blocker blocker; const int result = pthread_create(&impl->tid_, NULL, &Impl::run, impl.get());