diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/math/test/compile_test/poison.hpp | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/math/test/compile_test/poison.hpp')
-rw-r--r-- | src/boost/libs/math/test/compile_test/poison.hpp | 141 |
1 files changed, 141 insertions, 0 deletions
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 <cmath> +#include <math.h> + +// +// 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 <boost/config.hpp> +#include <valarray> +#include <complex> +#include <iosfwd> +#include <sstream> +#include <ostream> +#include <istream> +#include <utility> +#include <iomanip> +#include <typeinfo> +#include <stdexcept> +#include <cstddef> +#include <string> +#include <cstring> +#include <cctype> +#include <limits> +#include <exception> +#include <iterator> +#include <numeric> +#include <vector> +#include <algorithm> +#include <typeinfo> +#include <memory> +#include <cerrno> +#include <functional> +#ifndef BOOST_NO_CXX11_HDR_FUTURE +#include <future> +#endif +#ifndef BOOST_NO_CXX11_HDR_THREAD +#include <thread> +#endif +#ifndef BOOST_NO_CXX11_HDR_RANDOM +#include <random> +#endif +#ifndef BOOST_NO_CXX11_HDR_CHRONO +#include <chrono> +#endif +#include <map> + +// +// We have to include this *before* poisoning the macros +// as it needs to be able to use them! +// +#include <boost/math/special_functions/fpclassify.hpp> + +// +// 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 + |