mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Merge pull request #1930 from vadz/msvc-unreachable-warning-fix-alt
Avoid harmless warning about unreachable statement in MSVS build
This commit is contained in:
commit
db484cc4b8
@ -199,6 +199,12 @@ SPDLOG_INLINE bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
// avoid warning about unreachable statement at the end of filesize()
|
||||||
|
#pragma warning(push)
|
||||||
|
#pragma warning(disable: 4702)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Return file size according to open FILE* object
|
// Return file size according to open FILE* object
|
||||||
SPDLOG_INLINE size_t filesize(FILE *f)
|
SPDLOG_INLINE size_t filesize(FILE *f)
|
||||||
{
|
{
|
||||||
@ -249,6 +255,10 @@ SPDLOG_INLINE size_t filesize(FILE *f)
|
|||||||
return 0; // will not be reached.
|
return 0; // will not be reached.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
// Return utc offset in minutes or throw spdlog_ex on failure
|
// Return utc offset in minutes or throw spdlog_ex on failure
|
||||||
SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm)
|
SPDLOG_INLINE int utc_minutes_offset(const std::tm &tm)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user