clang fixes

This commit is contained in:
SChernykh
2021-08-23 11:31:16 +02:00
parent 133b8dde19
commit 4a5691e349
3 changed files with 7 additions and 19 deletions

View File

@@ -166,6 +166,10 @@ INT_ENTRY(uint16_t)
INT_ENTRY(uint32_t)
INT_ENTRY(uint64_t)
#ifdef __clang__
INT_ENTRY(unsigned long)
#endif
#undef INT_ENTRY
template<typename T, int base>
@@ -287,24 +291,6 @@ template<> struct log::Stream::Entry<std::string>
static FORCEINLINE void put(const std::string& value, Stream* wrapper) { wrapper->writeBuf(value.c_str(), value.length()); }
};
template<char... digits> struct to_str { static const char s[]; };
template<char... digits> constexpr char to_str<digits...>::s[] = { ('0' + digits)..., 0 };
template<uint64_t N, char... digits>
struct Str : Str<N / 10, N % 10, digits...> {};
template<char... digits>
struct Str<0, digits...> : to_str<digits...> {};
template<uint64_t N, char... digits>
struct log::Stream::Entry<Str<N, digits...>>
{
static FORCEINLINE void put(Str<N, digits...>&& value, Stream* wrapper)
{
wrapper->writeBuf(value.s, sizeof(value.s) - 1);
}
};
struct Hashrate
{
explicit FORCEINLINE Hashrate(uint64_t data) : m_data(data) {}