summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-05-30 13:59:53 +0300
committerTor Lillqvist <tml@collabora.com>2018-05-31 21:39:57 +0300
commit4df7830bfa67a973db1b2e801a7c045b1f5b50c6 (patch)
tree9fab680691cd8e96aeffdf15751b69a114fed7f8 /extensions
parent01ebbba2bbd2333c9bade8bf5b41e61ab9a3ec65 (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 (cherry picked from commit 3cce079c9307315f18b6f49f1de58f52e956e0d6)
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/ole/unoobjw.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index fb4c8d780e14..93071da58d38 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>