Skip to content

Commit

Permalink
Disable codecvt warning on Windows.
Browse files Browse the repository at this point in the history
The comment has more information about why we need this.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
  • Loading branch information
clalancette committed Feb 4, 2021
1 parent 681e833 commit 8f855b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rosidl_runtime_cpp/include/rosidl_runtime_cpp/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
#include <string>
#include <type_traits>

// In C++17 mode, MSVC 2019 warns that
// std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> is deprecated.
// However, it appears that there is no cross-platform replacement for it at present.
// Thus, we follow the warning advice and disable this warning for Windows.
#ifdef _WIN32
#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
#endif

namespace rosidl_generator_traits
{

Expand Down

0 comments on commit 8f855b7

Please sign in to comment.