From 631f407f99afee296d69338eef5d972e8e9ea3bb Mon Sep 17 00:00:00 2001 From: Gregory Czajkowski Date: Fri, 8 Nov 2013 17:06:54 -0800 Subject: [PATCH] add better support for different GCC and 64bit longs --- format.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/format.h b/format.h index 81c69db2..cdfaec0a 100644 --- a/format.h +++ b/format.h @@ -56,9 +56,11 @@ #endif #ifdef __GNUC__ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wlong-long" #endif +#endif namespace fmt { @@ -1185,9 +1187,10 @@ class FormatInt { *--str_ = '-'; } explicit FormatInt(unsigned value) : str_(FormatDecimal(value)) {} + explicit FormatInt(uint64_t value) : str_(FormatDecimal(value)) {} - const char *c_str() const { return str_; } - std::string str() const { return str_; } + inline const char *c_str() const { return str_; } + inline std::string str() const { return str_; } }; /** @@ -1237,7 +1240,9 @@ inline Formatter Print(StringRef format) { } #ifdef __GNUC__ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) # pragma GCC diagnostic pop #endif +#endif #endif // FORMAT_H_