From 27e48b7c2c69f5ec7209404173bfdeee7fa221f2 Mon Sep 17 00:00:00 2001 From: chenmou Date: Sun, 18 Jan 2026 20:55:12 +0800 Subject: [PATCH] Fix MSVC warning C4068 --- immer/detail/hamts/node.hpp | 8 ++++++++ immer/detail/rbts/node.hpp | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/immer/detail/hamts/node.hpp b/immer/detail/hamts/node.hpp index 32b8c92a..a59954da 100644 --- a/immer/detail/hamts/node.hpp +++ b/immer/detail/hamts/node.hpp @@ -18,9 +18,13 @@ // Disable some warnings for this file as it seems to be causing various // false positives when compiling with various versions of GCC. +#if !defined(_MSC_VER) +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif +#endif namespace immer { namespace detail { @@ -1159,4 +1163,8 @@ struct node } // namespace detail } // namespace immer +#if !defined(_MSC_VER) +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif +#endif diff --git a/immer/detail/rbts/node.hpp b/immer/detail/rbts/node.hpp index ca4cbf1f..df41ac18 100644 --- a/immer/detail/rbts/node.hpp +++ b/immer/detail/rbts/node.hpp @@ -21,10 +21,14 @@ // Disable some warnings for this file as it seems to be causing various // false positives when compiling with various versions of GCC. +#if !defined(_MSC_VER) +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" #pragma GCC diagnostic ignored "-Wnonnull" +#endif +#endif namespace immer { namespace detail { @@ -1039,4 +1043,8 @@ constexpr bits_t derive_bits_leaf = derive_bits_leaf_aux(); } // namespace detail } // namespace immer +#if !defined(_MSC_VER) +#if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop +#endif +#endif