Handle <codecvt> deprecation issue with VS2017
As VS2017 so eloquently puts it, "Warning STL4017: std::wbuffer_convert, std::wstring_convert, and the <codecvt> header (containing std::codecvt_mode, std::codecvt_utf8, std::codecvt_utf16, and std::codecvt_utf8_utf16) are deprecated in C++17. (The std::codecvt class template is NOT deprecated.) The C++ Standard doesn't provide equivalent non-deprecated fu tml_ nctionality; consider using MultiByteToWideChar() and WideCharToMultiByte() from <Windows.h> instead. You can define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning." So VS2017 actually recommends using platform-specific API instead of standard C++ API that is or will be deprecated but has no standard replacement. Insane. Note that it is not enough to define that _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING just right where you are including <codecvt> because "for all of the warning suppression macros, you must define them before any C++ Standard Library header has been included (both <vector> etc. and <cstdlib> etc.)" as mentioned on https://blogs.msdn.microsoft.com/vcblog/2017/12/08/c17-feature-removals-and-deprecations/ So define it in the single file that includes windowsdebugoutput.hxx for now. Change-Id: Iecd9702502ce3b33013d6799c618d6b98d803c3e
Showing
Please
register
or
sign in
to comment