decoder/plugin: kludge for Android NDK r25c

This commit is contained in:
Max Kellermann 2023-03-12 19:52:41 +01:00
parent 89d66b6100
commit b5eff3cecd
1 changed files with 14 additions and 1 deletions

View File

@ -20,13 +20,26 @@ DecoderPlugin::SupportsUri(const char *uri) const noexcept
return false;
}
[[gnu::pure]]
static bool
SetContains(const auto &set, const auto &key) noexcept
{
#ifdef ANDROID
/* the libc++ version in Android NDK r25c doesn't implement
std::set::contains() */
return set.find(key) != set.end();
#else
return set.contains(key);
#endif
}
bool
DecoderPlugin::SupportsSuffix(std::string_view suffix) const noexcept
{
return (suffixes != nullptr &&
StringArrayContainsCase(suffixes, suffix)) ||
(suffixes_function != nullptr &&
suffixes_function().contains(suffix));
SetContains(suffixes_function(), suffix));
}
bool