Browse Source

Fix MSVC warnings in utils\*

pull/6809/head
obligaron 2 years ago committed by Anders Jenbo
parent
commit
48b2b7a50c
  1. 5
      CMakeLists.txt
  2. 2
      Source/utils/console.cpp

5
CMakeLists.txt

@ -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)

2
Source/utils/console.cpp

@ -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

Loading…
Cancel
Save