From a53343476cee9fcbb7a5efc7a4b82f1ed7742d71 Mon Sep 17 00:00:00 2001 From: Levi Behunin Date: Fri, 22 Oct 2021 13:10:23 -0600 Subject: [PATCH] More pre c++20 removal and correcly disable 4324 --- src/common/atomic_threadsafe_queue.h | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/common/atomic_threadsafe_queue.h b/src/common/atomic_threadsafe_queue.h index dbca03f3de..0c4a792968 100644 --- a/src/common/atomic_threadsafe_queue.h +++ b/src/common/atomic_threadsafe_queue.h @@ -21,26 +21,19 @@ SOFTWARE. */ #pragma once +#pragma warning(push) +#pragma warning(disable : 4324) #include #include #include // offsetof #include -#include // std::hardware_destructive_interference_size +#include #include namespace Common { namespace mpmc { -#ifdef __cpp_lib_hardware_interference_size -static constexpr size_t hardwareInterferenceSize = std::hardware_destructive_interference_size; -#else static constexpr size_t hardwareInterferenceSize = 64; -#endif - -#if defined(_MSC_VER) -// Disables "structure was padded due to alignment specifier" warnings. -#pragma warning(suppress : 4324) -#endif template using AlignedAllocator = std::allocator; @@ -238,4 +231,8 @@ private: template >> using MPMCQueue = mpmc::Queue; -} // namespace Common \ No newline at end of file +} // namespace Common + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif \ No newline at end of file