Skip to content

Commit

Permalink
Merge branch 'gabime:v1.x' into v1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellGengYF authored Jan 15, 2024
2 parents 24b481f + 8979f7f commit 1b7c9bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ if(SPDLOG_NO_EXCEPTIONS)
if(NOT MSVC)
target_compile_options(spdlog PRIVATE -fno-exceptions)
else()
target_compile_options(spdlog PRIVATE /EHsc)
target_compile_options(spdlog PRIVATE /EHs-c-)
endif()
endif()
# ---------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions include/spdlog/details/file_helper-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ SPDLOG_INLINE void file_helper::close() {
}

SPDLOG_INLINE void file_helper::write(const memory_buf_t &buf) {
if(fd_ == nullptr) return;
size_t msg_size = buf.size();
auto data = buf.data();
if (std::fwrite(data, 1, msg_size, fd_) != msg_size) {
Expand Down
6 changes: 3 additions & 3 deletions include/spdlog/details/os-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ SPDLOG_INLINE int rename(const filename_t &filename1, const filename_t &filename
// Return true if path exists (file or directory)
SPDLOG_INLINE bool path_exists(const filename_t &filename) SPDLOG_NOEXCEPT {
#ifdef _WIN32
struct _stat buffer;
#ifdef SPDLOG_WCHAR_FILENAMES
auto attribs = ::GetFileAttributesW(filename.c_str());
return (::_wstat(filename.c_str(), &buffer) == 0);
#else
auto attribs = ::GetFileAttributesA(filename.c_str());
return (::_stat(filename.c_str(), &buffer) == 0);
#endif
return attribs != INVALID_FILE_ATTRIBUTES;
#else // common linux/unix all have the stat system call
struct stat buffer;
return (::stat(filename.c_str(), &buffer) == 0);
Expand Down
2 changes: 1 addition & 1 deletion include/spdlog/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#define SPDLOG_VER_MAJOR 1
#define SPDLOG_VER_MINOR 12
#define SPDLOG_VER_MINOR 13
#define SPDLOG_VER_PATCH 0

#define SPDLOG_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch)
Expand Down

0 comments on commit 1b7c9bb

Please sign in to comment.