Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
cf9c4f39
Commit
cf9c4f39
authored
Dec 08, 2016
by
Francis Dupont
Browse files
[master] Merged trac5066 (enforce C++11)
parents
e348313f
37555482
Changes
16
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
cf9c4f39
...
...
@@ -117,6 +117,41 @@ 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
CXX_SAVED=$CXX
feature=
for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
if test "$retry" = "fail"; then
AC_MSG_ERROR([$feature (a C++11 feature) is not supported])
fi
if test "$retry" != "none"; then
AC_MSG_WARN([unsupported C++11 feature])
AC_MSG_NOTICE([retrying by adding $retry to $CXX])
CXX="$CXX_SAVED $retry"
fi
AC_MSG_CHECKING(std::unique_ptr support)
feature="std::unique_ptr"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <memory>],
[std::unique_ptr<int> a;])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(aggregate initialization support)
feature="aggregate initialization"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[#include <vector>],
[std::vector<int> foo = { 1, 2, 3};])],
[AC_MSG_RESULT([yes])
break],
[AC_MSG_RESULT([no])
continue])
done
dnl Determine if we are using GNU sed
GNU_SED=no
$SED --version 2> /dev/null | grep GNU > /dev/null 2>&1
...
...
src/lib/dns/master_loader.cc
View file @
cf9c4f39
// Copyright (C) 2012-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
6
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
<config.h>
#include
<dns/master_loader.h>
#include
<dns/master_lexer.h>
#include
<dns/name.h>
...
...
@@ -25,7 +27,7 @@
#include
<cstdio>
// 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
<
MasterLoaderImpl
>
impl
(
new
MasterLoaderImpl
(
""
,
zone_origin
,
zone_class
,
callbacks
,
add_callback
,
options
));
unique_ptr
<
MasterLoaderImpl
>
impl
(
new
MasterLoaderImpl
(
""
,
zone_origin
,
zone_class
,
callbacks
,
add_callback
,
options
));
impl
->
pushStreamSource
(
stream
);
impl_
=
impl
.
release
();
}
...
...
src/lib/dns/rdata.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<exceptions/exceptions.h>
#include
<util/buffer.h>
...
...
@@ -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
<
GenericImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
GenericImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
rdata_string
);
...
...
src/lib/dns/rdata/any_255/tsig_250.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<string>
#include
<sstream>
#include
<vector>
...
...
@@ -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
<
TSIGImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
TSIGImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
tsig_str
);
...
...
src/lib/dns/rdata/generic/caa_257.cc
View file @
cf9c4f39
// Copyright (C) 2014-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2014-201
6
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
<
CAAImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
CAAImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
caa_str
);
...
...
src/lib/dns/rdata/generic/dnskey_48.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<iostream>
#include
<string>
#include
<sstream>
...
...
@@ -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
<
DNSKEYImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
DNSKEYImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
dnskey_str
);
...
...
src/lib/dns/rdata/generic/nsec3_50.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<iostream>
#include
<iomanip>
#include
<string>
...
...
@@ -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
<
NSEC3Impl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
NSEC3Impl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
nsec3_str
);
...
...
src/lib/dns/rdata/generic/nsec3param_51.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<util/buffer.h>
#include
<util/encode/hex.h>
...
...
@@ -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
<
NSEC3PARAMImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
NSEC3PARAMImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
nsec3param_str
);
...
...
src/lib/dns/rdata/generic/opt_41.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<
OPTImpl
>
impl_ptr
(
new
OPTImpl
);
std
::
unique
_ptr
<
OPTImpl
>
impl_ptr
(
new
OPTImpl
);
while
(
true
)
{
if
(
rdata_len
==
0
)
{
...
...
src/lib/dns/rdata/generic/rrsig_46.cc
View file @
cf9c4f39
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<string>
#include
<iomanip>
#include
<iostream>
...
...
@@ -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
<
RRSIGImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
RRSIGImpl
>
impl_ptr
;
try
{
std
::
istringstream
iss
(
rrsig_str
);
...
...
src/lib/dns/rdata/generic/sshfp_44.cc
View file @
cf9c4f39
// Copyright (C) 2012-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
6
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
<
SSHFPImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
SSHFPImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
sshfp_str
);
...
...
src/lib/dns/rdataclass.cc
View file @
cf9c4f39
...
...
@@ -5,12 +5,14 @@
///////////////
///////////////
// Copyright (C) 2010-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<string>
#include
<sstream>
#include
<vector>
...
...
@@ -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
<
TSIGImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
TSIGImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2014-201
6
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
<
CAAImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
CAAImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<iostream>
#include
<string>
#include
<sstream>
...
...
@@ -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
<
DNSKEYImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
DNSKEYImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<iostream>
#include
<iomanip>
#include
<string>
...
...
@@ -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
<
NSEC3Impl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
NSEC3Impl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<util/buffer.h>
#include
<util/encode/hex.h>
...
...
@@ -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
<
NSEC3PARAMImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
NSEC3PARAMImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<
OPTImpl
>
impl_ptr
(
new
OPTImpl
);
std
::
unique
_ptr
<
OPTImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2010-201
6
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
<config.h>
#include
<string>
#include
<iomanip>
#include
<iostream>
...
...
@@ -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
<
RRSIGImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
RRSIGImpl
>
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-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
6
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
<
SSHFPImpl
>
impl_ptr
(
NULL
)
;
std
::
unique
_ptr
<
SSHFPImpl
>
impl_ptr
;
try
{
std
::
istringstream
ss
(
sshfp_str
);
...
...
src/lib/log/Makefile.am
View file @
cf9c4f39
...
...
@@ -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
...
...
src/lib/util/threads/sync.cc
View file @
cf9c4f39
// Copyright (C) 2012-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
6
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
<pthread.h>
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
>
impl
(
new
Impl
);
unique
_ptr
<
Impl
>
impl
(
new
Impl
);
result
=
pthread_mutex_init
(
&
impl
->
mutex
,
&
attributes
);
switch
(
result
)
{
case
0
:
// All 0K
...
...
src/lib/util/threads/sync.h
View file @
cf9c4f39
// Copyright (C) 2012-201
5
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
6
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
{
...
...
src/lib/util/threads/thread.cc
View file @
cf9c4f39
...
...
@@ -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
<config.h>
#include
<util/threads/thread.h>
#include
<util/threads/sync.h>
...
...
@@ -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
<
void
()
>&
main
)
:
impl_
(
NULL
)
{
auto
_ptr
<
Impl
>
impl
(
new
Impl
(
main
));
unique
_ptr
<
Impl
>
impl
(
new
Impl
(
main
));
Blocker
blocker
;
const
int
result
=
pthread_create
(
&
impl
->
tid_
,
NULL
,
&
Impl
::
run
,
impl
.
get
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment