Move implementation specific stuff from format.h to format.cc.

This commit is contained in:
Victor Zverovich
2014-08-15 08:40:03 -07:00
parent c7cfa7d4e7
commit fb32161fa4
4 changed files with 25 additions and 24 deletions

View File

@@ -109,6 +109,12 @@ inline int safe_printf(char *buffer, size_t size, const char *format, ...) {
#endif // _MSC_VER
template <typename T>
struct IsLongDouble { enum {VALUE = 0}; };
template <>
struct IsLongDouble<long double> { enum {VALUE = 1}; };
const char RESET_COLOR[] = "\x1b[0m";
typedef void (*FormatFunc)(fmt::Writer &, int , fmt::StringRef);
@@ -260,8 +266,6 @@ inline Arg::StringValue<wchar_t> ignore_incompatible_str(
Arg::StringValue<wchar_t> s) { return s; }
} // namespace
int fmt::internal::signbit_noinline(double value) { return getsign(value); }
void fmt::SystemError::init(
int error_code, StringRef format_str, const ArgList &args) {
error_code_ = error_code;
@@ -645,7 +649,7 @@ void fmt::BasicWriter<Char>::write_double(T value, const FormatSpec &spec) {
*format_ptr++ = '.';
*format_ptr++ = '*';
}
if (internal::IsLongDouble<T>::VALUE)
if (IsLongDouble<T>::VALUE)
*format_ptr++ = 'L';
*format_ptr++ = type;
*format_ptr = '\0';