forked from fmtlib/fmt
Fix compiler warnings
This commit is contained in:
@ -46,19 +46,30 @@
|
|||||||
# define FMT_USE_NOEXCEPT 0
|
# define FMT_USE_NOEXCEPT 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
|
||||||
|
(FMT_GCC_VERSION >= 408 && FMT_HAS_GXX_CXX11) || \
|
||||||
|
FMT_MSC_VER >= 1900
|
||||||
|
# define FMT_DETECTED_NOEXCEPT noexcept
|
||||||
|
#else
|
||||||
|
# define FMT_DETECTED_NOEXCEPT throw()
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef FMT_NOEXCEPT
|
#ifndef FMT_NOEXCEPT
|
||||||
# if FMT_EXCEPTIONS
|
# if FMT_EXCEPTIONS
|
||||||
# if FMT_USE_NOEXCEPT || FMT_HAS_FEATURE(cxx_noexcept) || \
|
# define FMT_NOEXCEPT FMT_DETECTED_NOEXCEPT
|
||||||
FMT_GCC_VERSION >= 408 || FMT_MSC_VER >= 1900
|
|
||||||
# define FMT_NOEXCEPT noexcept
|
|
||||||
# else
|
|
||||||
# define FMT_NOEXCEPT throw()
|
|
||||||
# endif
|
|
||||||
# else
|
# else
|
||||||
# define FMT_NOEXCEPT
|
# define FMT_NOEXCEPT
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// This is needed because GCC still uses throw() in its headers when exceptions
|
||||||
|
// are disabled.
|
||||||
|
#if FMT_GCC_VERSION
|
||||||
|
# define FMT_DTOR_NOEXCEPT FMT_DETECTED_NOEXCEPT
|
||||||
|
#else
|
||||||
|
# define FMT_DTOR_NOEXCEPT FMT_NOEXCEPT
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
#if !defined(FMT_HEADER_ONLY) && defined(_WIN32)
|
||||||
# ifdef FMT_EXPORT
|
# ifdef FMT_EXPORT
|
||||||
# define FMT_API __declspec(dllexport)
|
# define FMT_API __declspec(dllexport)
|
||||||
|
@ -2104,7 +2104,7 @@ class system_error : public std::runtime_error {
|
|||||||
init(error_code, message, make_args(args...));
|
init(error_code, message, make_args(args...));
|
||||||
}
|
}
|
||||||
|
|
||||||
~system_error() throw();
|
~system_error() FMT_DTOR_NOEXCEPT;
|
||||||
|
|
||||||
int error_code() const { return error_code_; }
|
int error_code() const { return error_code_; }
|
||||||
};
|
};
|
||||||
|
@ -137,7 +137,7 @@ class BufferedFile {
|
|||||||
BufferedFile() FMT_NOEXCEPT : file_(0) {}
|
BufferedFile() FMT_NOEXCEPT : file_(0) {}
|
||||||
|
|
||||||
// Destroys the object closing the file it represents if any.
|
// Destroys the object closing the file it represents if any.
|
||||||
~BufferedFile() FMT_NOEXCEPT;
|
~BufferedFile() FMT_DTOR_NOEXCEPT;
|
||||||
|
|
||||||
#if !FMT_USE_RVALUE_REFERENCES
|
#if !FMT_USE_RVALUE_REFERENCES
|
||||||
// Emulate a move constructor and a move assignment operator if rvalue
|
// Emulate a move constructor and a move assignment operator if rvalue
|
||||||
@ -310,7 +310,7 @@ class File {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Destroys the object closing the file it represents if any.
|
// Destroys the object closing the file it represents if any.
|
||||||
~File() FMT_NOEXCEPT;
|
~File() FMT_DTOR_NOEXCEPT;
|
||||||
|
|
||||||
// Returns the file descriptor.
|
// Returns the file descriptor.
|
||||||
int descriptor() const FMT_NOEXCEPT { return fd_; }
|
int descriptor() const FMT_NOEXCEPT { return fd_; }
|
||||||
|
Reference in New Issue
Block a user