fix: duplicate template instantiation on raspberry pi armv7 (#3200)

This commit is contained in:
Charles Kerr 2022-06-05 00:01:23 -05:00 committed by GitHub
parent 84195254ec
commit 8806f9af68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -798,7 +798,7 @@ static void sessionSetImpl(struct init_data* const data)
if (tr_variantDictFindStrView(settings, TR_KEY_umask, &sv))
{
/* Read a umask as a string representing an octal number. */
session->umask = tr_parseNum<mode_t>(sv, 8).value_or(DefaultUmask);
session->umask = static_cast<mode_t>(tr_parseNum<uint32_t>(sv, 8).value_or(DefaultUmask));
umask(session->umask);
}
else if (tr_variantDictFindInt(settings, TR_KEY_umask, &i))

View File

@ -1416,12 +1416,12 @@ template<typename T, std::enable_if_t<std::is_integral<T>::value, bool>>
#endif // #if defined(__GNUC__) && !__has_include(<charconv>)
template std::optional<int64_t> tr_parseNum(std::string_view& sv, int base);
template std::optional<int> tr_parseNum(std::string_view& sv, int base);
template std::optional<size_t> tr_parseNum(std::string_view& sv, int base);
template std::optional<int32_t> tr_parseNum(std::string_view& sv, int base);
template std::optional<int8_t> tr_parseNum(std::string_view& sv, int base);
#ifndef _WIN32
template std::optional<mode_t> tr_parseNum(std::string_view& sv, int base);
#endif
template std::optional<uint64_t> tr_parseNum(std::string_view& sv, int base);
template std::optional<uint32_t> tr_parseNum(std::string_view& sv, int base);
template std::optional<uint8_t> tr_parseNum(std::string_view& sv, int base);
template<typename T, std::enable_if_t<std::is_floating_point<T>::value, bool>>
[[nodiscard]] std::optional<T> tr_parseNum(std::string_view& sv)