From c66ac111ab66e1aecf0a5774f65186c9935ed68a Mon Sep 17 00:00:00 2001 From: Raymonf Date: Thu, 20 Aug 2020 17:47:38 -0400 Subject: [PATCH] Silence codecvt deprecation warning on VC++ --- src/CNStructs.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CNStructs.hpp b/src/CNStructs.hpp index 3c6bfdd..8fd70ca 100644 --- a/src/CNStructs.hpp +++ b/src/CNStructs.hpp @@ -5,14 +5,20 @@ #ifndef _CNS_HPP #define _CNS_HPP +#ifdef _MSC_VER +// codecvt_* is deprecated in C++17 and MSVC will throw an annoying warning because of that. +// Defining this before anything else to silence it. +#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING +#endif + #include #include #include -// Can't use this in MSVC. #ifndef _MSC_VER - #include +#include #else - #include +// Can't use this in MSVC. +#include #endif #include #include