mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
add better support for different GCC and 64bit longs
This commit is contained in:
parent
0a95f7c2fa
commit
631f407f99
9
format.h
9
format.h
@ -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_
|
||||||
|
Loading…
Reference in New Issue
Block a user