fix_narrowing.patch (1844B)
1 diff --git a/Release/src/CMakeLists.txt b/Release/src/CMakeLists.txt 2 index e15aeb7fc..128f6d6af 100644 3 --- a/Release/src/CMakeLists.txt 4 +++ b/Release/src/CMakeLists.txt 5 @@ -185,12 +185,12 @@ endif() 6 7 configure_pch(cpprest stdafx.h pch/stdafx.cpp /Zm120) 8 9 -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") 10 +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT MSVC) 11 if(WERROR) 12 target_compile_options(cpprest PRIVATE -Werror) 13 endif() 14 target_compile_options(cpprest PRIVATE -pedantic ${WARNINGS}) 15 -elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 16 +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT MATCHES "MSVC") 17 if(WERROR) 18 target_compile_options(cpprest PRIVATE /WX ${WARNINGS}) 19 endif() 20 diff --git a/Release/src/streams/fileio_win32.cpp b/Release/src/streams/fileio_win32.cpp 21 index 057dd9b67..a65439cb7 100644 22 --- a/Release/src/streams/fileio_win32.cpp 23 +++ b/Release/src/streams/fileio_win32.cpp 24 @@ -616,7 +616,7 @@ size_t _fill_buffer_fsb(_In_ _file_info_impl* fInfo, 25 // pending 26 return read; 27 28 - case (-1): 29 + case ((size_t)(-1)): 30 // error 31 delete cb; 32 return read; 33 @@ -668,7 +668,7 @@ size_t _fill_buffer_fsb(_In_ _file_info_impl* fInfo, 34 // pending 35 return read; 36 37 - case (-1): 38 + case ((size_t)(-1)): 39 // error 40 delete cb; 41 return read; 42 @@ -719,7 +719,7 @@ size_t _fill_buffer_fsb(_In_ _file_info_impl* fInfo, 43 // pending 44 return read; 45 46 - case (-1): 47 + case ((size_t)(-1)): 48 // error 49 delete cb; 50 return read;