Skip to content

Commit

Permalink
Fix MSVC warnings in utils\*
Browse files Browse the repository at this point in the history
  • Loading branch information
obligaron authored and AJenbo committed Nov 13, 2023
1 parent 2554a99 commit 48b2b7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
add_link_options("$<$<BOOL:${DEVILUTIONX_PROFILE_DIR}>:-fprofile-dir=${DEVILUTIONX_PROFILE_DIR};-fprofile-prefix-path=${CMAKE_CURRENT_BINARY_DIR}>")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# u8path() function is deprecated but there is no sensible alternative and it might even get un-deprecated.
add_definitions(-D_SILENCE_CXX20_U8PATH_DEPRECATION_WARNING)
endif()

# Not a genexp because CMake doesn't support it
# https://gitlab.kitware.com/cmake/cmake/-/issues/20546
if(NOT DISABLE_LTO)
Expand Down
2 changes: 1 addition & 1 deletion Source/utils/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void WriteToStderr(std::string_view str)
HANDLE handle = GetStderrHandle();
if (handle == NULL)
return;
WriteConsole(handle, str.data(), str.size(), NULL, NULL);
WriteConsole(handle, str.data(), static_cast<DWORD>(str.size()), NULL, NULL);
}

} // namespace
Expand Down

0 comments on commit 48b2b7a

Please sign in to comment.