Silence MSVC codecvt deprecation warnings
authorAaron Ballman <aaron@aaronballman.com>
Mon, 15 Aug 2022 12:36:56 +0000 (08:36 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 15 Aug 2022 12:38:07 +0000 (08:38 -0400)
This silences warnings about use of deprecated codecvt functionality
after the switch to build with C++17.

third-party/benchmark/src/sysinfo.cc

index 87dcfb4..d9bd651 100644 (file)
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#if defined(_MSC_VER)
+// FIXME: This must be defined before any other includes to disable deprecation
+// warnings for use of codecvt from C++17. We should remove our reliance on
+// the deprecated functionality instead.
+#define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
+#endif
+
 #include "internal_macros.h"
 
 #ifdef BENCHMARK_OS_WINDOWS