From fe5f1a4fcd371bac73b13fd134e576d582922f3b Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 18 May 2021 19:56:42 +0100 Subject: [PATCH] Correct pp-logic. --- test/threading_sanity_check.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/threading_sanity_check.cpp b/test/threading_sanity_check.cpp index 5f19483f8..7e9ef8162 100644 --- a/test/threading_sanity_check.cpp +++ b/test/threading_sanity_check.cpp @@ -4,20 +4,22 @@ // (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) +#include + +#if !defined(BOOST_MATH_NO_THREAD_LOCAL_WITH_NON_TRIVIAL_TYPES) && defined(BOOST_HAS_THREADS) + #include #include #include #include #include #include -#include std::atomic counter{ 0 }; void thread_proc() { -#ifndef BOOST_MATH_NO_THREAD_LOCAL_WITH_NON_TRIVIAL_TYPES static thread_local std::vector list; std::default_random_engine rnd; @@ -29,7 +31,6 @@ void thread_proc() ++counter; } std::sort(list.begin(), list.end()); -#endif } int main() @@ -52,3 +53,9 @@ int main() return counter - 6000; } + +#else + +int main() { return 0; } + +#endif