add better support for different GCC and 64bit longs

This commit is contained in:
Gregory Czajkowski 2013-11-08 17:06:54 -08:00
parent 0a95f7c2fa
commit 631f407f99

View File

@ -56,9 +56,11 @@
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic push # pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wlong-long" # pragma GCC diagnostic ignored "-Wlong-long"
#endif #endif
#endif
namespace fmt { namespace fmt {
@ -1185,9 +1187,10 @@ class FormatInt {
*--str_ = '-'; *--str_ = '-';
} }
explicit FormatInt(unsigned value) : str_(FormatDecimal(value)) {} explicit FormatInt(unsigned value) : str_(FormatDecimal(value)) {}
explicit FormatInt(uint64_t value) : str_(FormatDecimal(value)) {}
const char *c_str() const { return str_; } inline const char *c_str() const { return str_; }
std::string str() const { return str_; } inline std::string str() const { return str_; }
}; };
/** /**
@ -1237,7 +1240,9 @@ inline Formatter<Write> Print(StringRef format) {
} }
#ifdef __GNUC__ #ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
# pragma GCC diagnostic pop # pragma GCC diagnostic pop
#endif #endif
#endif
#endif // FORMAT_H_ #endif // FORMAT_H_