UPnP: Fix compatibility with Debian's old versions

qteditor
Lukas Werling 2016-06-03 21:58:19 +02:00
parent 55c52a69a5
commit 91e2c137d9
1 changed files with 7 additions and 2 deletions

View File

@ -26,6 +26,11 @@
#include "network/C4Network2UPnP.h"
// Backwards compatibility for Debian's miniupnpc 1.9.20140610
#ifndef UPNP_LOCAL_PORT_ANY
#define UPNP_LOCAL_PORT_ANY 0
#endif
static const char *description = "OpenClonk";
class C4Network2UPnPP : C4InteractiveThread
@ -107,7 +112,7 @@ void C4Network2UPnPP::AddMapping(C4Network2IOProtocol protocol, uint16_t intport
added_mappings.push_back(mapping);
action = std::async([this, action{std::move(action)}, mapping]() {
action = std::async([this, action = std::move(action), mapping]() {
action.wait();
AddPortMapping(mapping);
});
@ -115,7 +120,7 @@ void C4Network2UPnPP::AddMapping(C4Network2IOProtocol protocol, uint16_t intport
void C4Network2UPnPP::ClearMappings()
{
action = std::async([this, action{std::move(action)}]() {
action = std::async([this, action = std::move(action)]() {
action.wait();
for (auto mapping : added_mappings)