Adjust code for some older GCC versions
Implicit conversion from raw-pointer to std::unique_ptr<T> was failing, use a stub replacement for std::make_unqiue to wrap this up cleanly.
This commit is contained in:
parent
7738f33306
commit
4ed410dc09
1 changed files with 12 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
// dbus-dispatcher.cpp
|
// dbus-dispatcher.cpp
|
||||||
//
|
//
|
||||||
// Copyright (C) 2019 - swift Project Community / Contributors (http://swift-project.org/)
|
// Copyright (C) 2019 - swift Project Community / Contributors (http://swift-project.org/)
|
||||||
// Adapted to Flightgear by Lars Toenning <dev@ltoenning.de>
|
// Adapted to Flightgear by Lars Toenning <dev@ltoenning.de>
|
||||||
//
|
//
|
||||||
|
@ -21,6 +21,15 @@
|
||||||
#include "dbusconnection.h"
|
#include "dbusconnection.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
namespace { // anonymosu namespace
|
||||||
|
|
||||||
|
template <typename T, typename... Args>
|
||||||
|
std::unique_ptr<T> our_make_unique(Args&&... args) {
|
||||||
|
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
} // end of anonymous namespace
|
||||||
|
|
||||||
namespace FGSwiftBus
|
namespace FGSwiftBus
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -198,7 +207,7 @@ namespace FGSwiftBus
|
||||||
if (dbus_watch_get_enabled(watch) == FALSE) { return true; }
|
if (dbus_watch_get_enabled(watch) == FALSE) { return true; }
|
||||||
|
|
||||||
int fd = dbus_watch_get_unix_fd(watch);
|
int fd = dbus_watch_get_unix_fd(watch);
|
||||||
m_watchers.emplace(fd, new WatchHandler(m_eventBase.get(), watch));
|
m_watchers.emplace(fd, our_make_unique<WatchHandler>(m_eventBase.get(), watch));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue