mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 04:52:03 +00:00
More cleanup
This commit is contained in:
parent
715f2b4c00
commit
ff6e46ed97
@ -25,7 +25,7 @@
|
||||
#endif
|
||||
|
||||
#if defined(__has_include) && !defined(__INTELLISENSE__) && \
|
||||
(!defined(__INTEL_COMPILER) || __INTEL_COMPILER >= 1600)
|
||||
!(defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1600)
|
||||
# define FMT_HAS_INCLUDE(x) __has_include(x)
|
||||
#else
|
||||
# define FMT_HAS_INCLUDE(x) 0
|
||||
@ -72,7 +72,7 @@
|
||||
|
||||
#ifndef FMT_USE_CONSTEXPR11
|
||||
# define FMT_USE_CONSTEXPR11 \
|
||||
(FMT_MSC_VER >= 1900 || FMT_GCC_VERSION >= 406 || FMT_USE_CONSTEXPR)
|
||||
(FMT_USE_CONSTEXPR || FMT_GCC_VERSION >= 406 || FMT_MSC_VER >= 1900)
|
||||
#endif
|
||||
#if FMT_USE_CONSTEXPR11
|
||||
# define FMT_CONSTEXPR11 constexpr
|
||||
@ -104,24 +104,15 @@
|
||||
# define FMT_NULL NULL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_NULLPTR
|
||||
# define FMT_USE_NULLPTR 0
|
||||
#endif
|
||||
|
||||
#if FMT_HAS_CPP_ATTRIBUTE(noreturn)
|
||||
# define FMT_NORETURN [[noreturn]]
|
||||
#else
|
||||
# define FMT_NORETURN
|
||||
#endif
|
||||
|
||||
// Check if exceptions are disabled.
|
||||
#if defined(__GNUC__) && !defined(__EXCEPTIONS)
|
||||
#if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || \
|
||||
FMT_MSC_VER && !_HAS_EXCEPTIONS
|
||||
# define FMT_EXCEPTIONS 0
|
||||
#elif FMT_MSC_VER && !_HAS_EXCEPTIONS
|
||||
# define FMT_EXCEPTIONS 0
|
||||
#endif
|
||||
#ifndef FMT_EXCEPTIONS
|
||||
#else
|
||||
# define FMT_EXCEPTIONS 1
|
||||
#endif
|
||||
|
||||
@ -147,8 +138,7 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// This is needed because GCC still uses throw() in its headers when exceptions
|
||||
// are disabled.
|
||||
// GCC still uses throw() in its headers when exceptions are disabled.
|
||||
#if FMT_GCC_VERSION
|
||||
# define FMT_DTOR_NOEXCEPT FMT_DETECTED_NOEXCEPT
|
||||
#else
|
||||
@ -358,11 +348,8 @@ struct formatter {
|
||||
};
|
||||
|
||||
template <typename T, typename Char, typename Enable = void>
|
||||
struct convert_to_int {
|
||||
enum {
|
||||
value = !std::is_arithmetic<T>::value && std::is_convertible<T, int>::value
|
||||
};
|
||||
};
|
||||
struct convert_to_int: std::integral_constant<
|
||||
bool, !std::is_arithmetic<T>::value && std::is_convertible<T, int>::value> {};
|
||||
|
||||
namespace internal {
|
||||
|
||||
@ -1454,8 +1441,7 @@ inline void print(std::FILE *f, string_view format_str, const Args & ... args) {
|
||||
set via ``fwide(f, 1)`` or ``_setmode(_fileno(f), _O_U8TEXT)`` on Windows.
|
||||
*/
|
||||
template <typename... Args>
|
||||
inline void print(std::FILE *f, wstring_view format_str,
|
||||
const Args & ... args) {
|
||||
inline void print(std::FILE *f, wstring_view format_str, const Args &... args) {
|
||||
format_arg_store<wformat_context, Args...> as(args...);
|
||||
vprint(f, format_str, as);
|
||||
}
|
||||
|
@ -24,6 +24,12 @@
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
#if FMT_HAS_CPP_ATTRIBUTE(noreturn)
|
||||
# define FMT_NORETURN [[noreturn]]
|
||||
#else
|
||||
# define FMT_NORETURN
|
||||
#endif
|
||||
|
||||
using fmt::internal::fp;
|
||||
|
||||
template <bool is_iec559>
|
||||
|
Loading…
Reference in New Issue
Block a user