db/upnp: add fallback for emplace()
The method emplace() was added in gcc 4.8. This commit restores compatibility with gcc 4.7.
This commit is contained in:
parent
ca43e634b5
commit
a4d580a6f8
|
@ -829,8 +829,13 @@ UpnpDatabase::VisitUniqueTags(const DatabaseSelection &selection,
|
||||||
|
|
||||||
for (auto &dirent : dirbuf.m_items) {
|
for (auto &dirent : dirbuf.m_items) {
|
||||||
std::string tagvalue;
|
std::string tagvalue;
|
||||||
if (getTagValue(dirent, tag, tagvalue))
|
if (getTagValue(dirent, tag, tagvalue)) {
|
||||||
|
#if defined(__clang__) || GCC_CHECK_VERSION(4,8)
|
||||||
values.emplace(std::move(tagvalue));
|
values.emplace(std::move(tagvalue));
|
||||||
|
#else
|
||||||
|
values.insert(std::move(tagvalue));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,11 @@ discoExplorer(void *)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__clang__) || GCC_CHECK_VERSION(4,8)
|
||||||
auto e = contentDirectories.m_directories.emplace(tsk->deviceId, d);
|
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)
|
if (!e.second)
|
||||||
e.first->second = d;
|
e.first->second = d;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue