From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/math/test/compile_test/poison.hpp | 141 +++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 src/boost/libs/math/test/compile_test/poison.hpp (limited to 'src/boost/libs/math/test/compile_test/poison.hpp') diff --git a/src/boost/libs/math/test/compile_test/poison.hpp b/src/boost/libs/math/test/compile_test/poison.hpp new file mode 100644 index 00000000..6d72d9d2 --- /dev/null +++ b/src/boost/libs/math/test/compile_test/poison.hpp @@ -0,0 +1,141 @@ +// Copyright John Maddock 2013. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_COMPILE_POISON_HPP +#define BOOST_MATH_COMPILE_POISON_HPP + +#include +#include + +// +// As per https://github.com/boostorg/math/issues/126 +// we basically need to include every std lib header we use, otherwise +// our poisoned macros can break legit std lib code. +// +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef BOOST_NO_CXX11_HDR_FUTURE +#include +#endif +#ifndef BOOST_NO_CXX11_HDR_THREAD +#include +#endif +#ifndef BOOST_NO_CXX11_HDR_RANDOM +#include +#endif +#ifndef BOOST_NO_CXX11_HDR_CHRONO +#include +#endif +#include + +// +// We have to include this *before* poisoning the macros +// as it needs to be able to use them! +// +#include + +// +// Poison all the function-like macros in C99 so if we accidentally call them +// in an unsafe manner, we'll get compiler errors. Of course these shouldn't be +// macros in C++ at all... +// + +#ifdef fpclassify +#undef fpclassify +#endif + +#define fpclassify(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isfinite +#undef isfinite +#endif + +#define isfinite(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isinf +#undef isinf +#endif + +#define isinf(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isnan +#undef isnan +#endif + +#define isnan(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isnormal +#undef isnormal +#endif + +#define isnormal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef signbit +#undef signbit +#endif + +#define signbit(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isgreater +#undef isgreater +#endif + +#define isgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isgreaterequal +#undef isgreaterequal +#endif + +#define isgreaterequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isless +#undef isless +#endif + +#define isless(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef islessequal +#undef islessequal +#endif + +#define islessequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef islessgreater +#undef islessgreater +#endif + +#define islessgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#ifdef isunordered +#undef isunordered +#endif + +#define isunordered(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} + +#endif + -- cgit v1.2.3