mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
fix(Core/Misc): Remove Clang 7 workaround (#10521)
This commit is contained in:
@@ -46,13 +46,6 @@ int main()
|
||||
}
|
||||
" CLANG_HAVE_PROPER_CHARCONV)
|
||||
|
||||
if (NOT CLANG_HAVE_PROPER_CHARCONV)
|
||||
message(STATUS "Clang: Detected from_chars bug for 64-bit integers, workaround enabled")
|
||||
target_compile_definitions(acore-compile-option-interface
|
||||
INTERFACE
|
||||
-DACORE_NEED_CHARCONV_WORKAROUND)
|
||||
endif()
|
||||
|
||||
if(WITH_WARNINGS)
|
||||
target_compile_options(acore-warning-interface
|
||||
INTERFACE
|
||||
|
||||
@@ -90,71 +90,6 @@ namespace Acore::Impl::StringConvertImpl
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef ACORE_NEED_CHARCONV_WORKAROUND
|
||||
/*
|
||||
If this is defined, std::from_chars will cause linkage errors for 64-bit types.
|
||||
(This is a bug in clang-7.)
|
||||
|
||||
If the clang requirement is bumped to >= clang-8, remove this ifdef block and its
|
||||
associated check in cmake/compiler/clang/settings.cmake
|
||||
*/
|
||||
template <>
|
||||
struct For<uint64, void>
|
||||
{
|
||||
static Optional<uint64> FromString(std::string_view str, int base = 10)
|
||||
{
|
||||
if (str.empty())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
try
|
||||
{
|
||||
size_t n;
|
||||
uint64 val = std::stoull(std::string(str), &n, base);
|
||||
if (n != str.length())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
catch (...) { return std::nullopt; }
|
||||
}
|
||||
|
||||
static std::string ToString(uint64 val)
|
||||
{
|
||||
return std::to_string(val);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct For<int64, void>
|
||||
{
|
||||
static Optional<int64> FromString(std::string_view str, int base = 10)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (str.empty())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
size_t n;
|
||||
int64 val = std::stoll(std::string(str), &n, base);
|
||||
if (n != str.length())
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
catch (...) { return std::nullopt; }
|
||||
}
|
||||
|
||||
static std::string ToString(int64 val)
|
||||
{
|
||||
return std::to_string(val);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
template <>
|
||||
struct For<bool, void>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user