Fixed clang errors
This commit is contained in:
parent
6daa6ce963
commit
d25b78aa2c
@ -99,31 +99,6 @@ const char fmt::internal::BasicData<T>::DIGITS[] =
|
|||||||
"6061626364656667686970717273747576777879"
|
"6061626364656667686970717273747576777879"
|
||||||
"8081828384858687888990919293949596979899";
|
"8081828384858687888990919293949596979899";
|
||||||
|
|
||||||
#define FMT_POWERS_OF_10(factor) \
|
|
||||||
factor * 10, \
|
|
||||||
factor * 100, \
|
|
||||||
factor * 1000, \
|
|
||||||
factor * 10000, \
|
|
||||||
factor * 100000, \
|
|
||||||
factor * 1000000, \
|
|
||||||
factor * 10000000, \
|
|
||||||
factor * 100000000, \
|
|
||||||
factor * 1000000000
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
const uint32_t fmt::internal::BasicData<T>::POWERS_OF_10_32[] = {
|
|
||||||
0, FMT_POWERS_OF_10(1)
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
const uint64_t fmt::internal::BasicData<T>::POWERS_OF_10_64[] = {
|
|
||||||
0,
|
|
||||||
FMT_POWERS_OF_10(1),
|
|
||||||
FMT_POWERS_OF_10(fmt::ULongLong(1000000000)),
|
|
||||||
// Multiply several constants instead of using a single long long constant
|
|
||||||
// to avoid warnings about C++98 not supporting long long.
|
|
||||||
fmt::ULongLong(1000000000) * fmt::ULongLong(1000000000) * 10
|
|
||||||
};
|
|
||||||
|
|
||||||
FMT_FUNC void fmt::internal::report_unknown_type(char code, const char *type) {
|
FMT_FUNC void fmt::internal::report_unknown_type(char code, const char *type) {
|
||||||
(void)type;
|
(void)type;
|
||||||
|
|||||||
46
fmt/format.h
46
fmt/format.h
@ -836,15 +836,45 @@ struct FMT_API BasicData {
|
|||||||
static const char DIGITS[];
|
static const char DIGITS[];
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifndef FMT_USE_EXTERN_TEMPLATES
|
#define FMT_POWERS_OF_10(factor) \
|
||||||
// Clang doesn't have a feature check for extern templates so we check
|
factor * 10, \
|
||||||
// for variadic templates which were introduced in the same version.
|
factor * 100, \
|
||||||
# define FMT_USE_EXTERN_TEMPLATES (__clang__ && FMT_USE_VARIADIC_TEMPLATES)
|
factor * 1000, \
|
||||||
#endif
|
factor * 10000, \
|
||||||
|
factor * 100000, \
|
||||||
|
factor * 1000000, \
|
||||||
|
factor * 10000000, \
|
||||||
|
factor * 100000000, \
|
||||||
|
factor * 1000000000
|
||||||
|
|
||||||
#if FMT_USE_EXTERN_TEMPLATES
|
template <typename T>
|
||||||
extern template struct BasicData<void>;
|
const uint32_t BasicData<T>::POWERS_OF_10_32[] = {
|
||||||
#endif
|
0, FMT_POWERS_OF_10(1)
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
const uint64_t fmt::internal::BasicData<T>::POWERS_OF_10_64[] = {
|
||||||
|
0,
|
||||||
|
FMT_POWERS_OF_10(1),
|
||||||
|
FMT_POWERS_OF_10(fmt::ULongLong(1000000000)),
|
||||||
|
// Multiply several constants instead of using a single long long constant
|
||||||
|
// to avoid warnings about C++98 not supporting long long.
|
||||||
|
fmt::ULongLong(1000000000) * fmt::ULongLong(1000000000) * 10
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// After the changes for 335, cland reported unedefined references to
|
||||||
|
/// BasicData<void>, so I put their definitions in the header.
|
||||||
|
// #ifndef FMT_USE_EXTERN_TEMPLATES
|
||||||
|
// // Clang doesn't have a feature check for extern templates so we check
|
||||||
|
// // for variadic templates which were introduced in the same version.
|
||||||
|
// # define FMT_USE_EXTERN_TEMPLATES (__clang__ && FMT_USE_VARIADIC_TEMPLATES)
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
// #if FMT_USE_EXTERN_TEMPLATES
|
||||||
|
// extern template struct BasicData<void>;
|
||||||
|
// #endif
|
||||||
|
|
||||||
typedef BasicData<> Data;
|
typedef BasicData<> Data;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user