diff options
Diffstat (limited to 'src/db/upnp/Discovery.cxx')
-rw-r--r-- | src/db/upnp/Discovery.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx index a94f29d8c..23705271d 100644 --- a/src/db/upnp/Discovery.cxx +++ b/src/db/upnp/Discovery.cxx @@ -142,7 +142,11 @@ discoExplorer(void *) continue; } +#if defined(__clang__) || GCC_CHECK_VERSION(4,8) auto e = contentDirectories.m_directories.emplace(tsk->deviceId, d); +#else + auto e = contentDirectories.m_directories.insert(std::make_pair(tsk->deviceId, d)); +#endif if (!e.second) e.first->second = d; } @@ -158,7 +162,7 @@ discoExplorer(void *) // mutex just for clarifying the message printing, the workqueue is // mt-safe of course. static int -cluCallBack(Upnp_EventType et, void *evp, void *) +cluCallBack(Upnp_EventType et, void *evp) { static Mutex cblock; const ScopeLock protect(cblock); @@ -231,11 +235,9 @@ UPnPDeviceDirectory::UPnPDeviceDirectory() if (lib == nullptr) return; - lib->registerHandler(UPNP_DISCOVERY_SEARCH_RESULT, cluCallBack, this); - lib->registerHandler(UPNP_DISCOVERY_ADVERTISEMENT_ALIVE, - cluCallBack, this); - lib->registerHandler(UPNP_DISCOVERY_ADVERTISEMENT_BYEBYE, - cluCallBack, this); + lib->SetHandler([](Upnp_EventType type, void *event){ + cluCallBack(type, event); + }); search(); } |