diff options
author | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:38:11 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-08-21 08:40:10 (GMT) |
commit | 381b22fc365c27b9cd585f4b78f53ebc698d9f54 (patch) | |
tree | 0ffd89a8be13293c75c7ddfea524c74e0bf87b72 /Swiften/Network/NATPMPInterface.cpp | |
parent | 8ec22a9c5591584fd1725ed028d714c51b7509d3 (diff) | |
download | swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.zip swift-contrib-381b22fc365c27b9cd585f4b78f53ebc698d9f54.tar.bz2 |
Clean up compilation errors in Swiften due to boost 1.56
Can no longer implicitly convert boost::optional to bool temporaries. Also fixed assorted uses of cerr where logging was appropriate.
Test-Information:
Swiften compiles against boost 1.56 (link fails for me so far)
Change-Id: Iec058af933a82a987da64291435a475f8b40ef96
Diffstat (limited to 'Swiften/Network/NATPMPInterface.cpp')
-rw-r--r-- | Swiften/Network/NATPMPInterface.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Swiften/Network/NATPMPInterface.cpp b/Swiften/Network/NATPMPInterface.cpp index c7a41ff..dcae641 100644 --- a/Swiften/Network/NATPMPInterface.cpp +++ b/Swiften/Network/NATPMPInterface.cpp @@ -1,15 +1,21 @@ /* * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ +/* +* Copyright (c) 2014 Kevin Smith +* Licensed under the GNU General Public License v3. +* See Documentation/Licenses/GPLv3.txt for more information. +*/ + #include <Swiften/Network/NATPMPInterface.h> #include <boost/smart_ptr/make_shared.hpp> #include <boost/numeric/conversion/cast.hpp> #include <Swiften/Base/Log.h> // This has to be included after the previous headers, because of WIN32 macro // being defined somewhere. @@ -26,19 +32,19 @@ struct NATPMPInterface::Private { NATPMPInterface::NATPMPInterface() : p(boost::make_shared<Private>()) { initnatpmp(&p->natpmp, 0, 0); } NATPMPInterface::~NATPMPInterface() { closenatpmp(&p->natpmp); } bool NATPMPInterface::isAvailable() { - return getPublicIP(); + return getPublicIP() ? true : false; } boost::optional<HostAddress> NATPMPInterface::getPublicIP() { if (sendpublicaddressrequest(&p->natpmp) < 0) { SWIFT_LOG(debug) << "Failed to send NAT-PMP public address request!" << std::endl; return boost::optional<HostAddress>(); } int r = 0; |