diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-05-30 13:59:53 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-05-30 14:46:08 +0300 |
commit | 3cce079c9307315f18b6f49f1de58f52e956e0d6 (patch) | |
tree | 53acfdc37b75b51ee4a1c1f44f5778d5f82118da /extensions | |
parent | d7f69b1cb4dbdd39970d56d0c340d7abb92fbdc1 (diff) |
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
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 1e2525791ee9..9cbbbbd9139f 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +// See https://blogs.msdn.microsoft.com/vcblog/2017/12/08/c17-feature-removals-and-deprecations/ +#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 1 + #include "ole2uno.hxx" #include <stdio.h> |