]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Copyright John Maddock 2013. |
2 | // Use, modification and distribution are subject to the | |
3 | // Boost Software License, Version 1.0. (See accompanying file | |
4 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | ||
6 | #ifndef BOOST_MATH_COMPILE_POISON_HPP | |
7 | #define BOOST_MATH_COMPILE_POISON_HPP | |
8 | ||
9 | #include <cmath> | |
10 | #include <math.h> | |
92f5a8d4 TL |
11 | |
12 | // | |
13 | // As per https://github.com/boostorg/math/issues/126 | |
14 | // we basically need to include every std lib header we use, otherwise | |
15 | // our poisoned macros can break legit std lib code. | |
16 | // | |
92f5a8d4 TL |
17 | #include <valarray> |
18 | #include <complex> | |
19 | #include <iosfwd> | |
20 | #include <sstream> | |
21 | #include <ostream> | |
22 | #include <istream> | |
23 | #include <utility> | |
24 | #include <iomanip> | |
25 | #include <typeinfo> | |
26 | #include <stdexcept> | |
27 | #include <cstddef> | |
28 | #include <string> | |
29 | #include <cstring> | |
30 | #include <cctype> | |
31 | #include <limits> | |
32 | #include <exception> | |
33 | #include <iterator> | |
34 | #include <numeric> | |
35 | #include <vector> | |
36 | #include <algorithm> | |
37 | #include <typeinfo> | |
38 | #include <memory> | |
39 | #include <cerrno> | |
40 | #include <functional> | |
92f5a8d4 | 41 | #include <future> |
92f5a8d4 | 42 | #include <thread> |
92f5a8d4 | 43 | #include <random> |
92f5a8d4 | 44 | #include <chrono> |
92f5a8d4 TL |
45 | #include <map> |
46 | ||
7c673cae FG |
47 | // |
48 | // We have to include this *before* poisoning the macros | |
49 | // as it needs to be able to use them! | |
50 | // | |
51 | #include <boost/math/special_functions/fpclassify.hpp> | |
1e59de90 TL |
52 | // |
53 | // lexical_cast uses macro unsafe isinf etc, so we have to include this as well: | |
54 | // | |
55 | #ifndef BOOST_MATH_STANDALONE | |
56 | #include <boost/lexical_cast.hpp> | |
57 | #endif | |
7c673cae FG |
58 | |
59 | // | |
60 | // Poison all the function-like macros in C99 so if we accidentally call them | |
61 | // in an unsafe manner, we'll get compiler errors. Of course these shouldn't be | |
62 | // macros in C++ at all... | |
63 | // | |
64 | ||
65 | #ifdef fpclassify | |
66 | #undef fpclassify | |
67 | #endif | |
68 | ||
69 | #define fpclassify(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
70 | ||
71 | #ifdef isfinite | |
72 | #undef isfinite | |
73 | #endif | |
74 | ||
75 | #define isfinite(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
76 | ||
77 | #ifdef isinf | |
78 | #undef isinf | |
79 | #endif | |
80 | ||
81 | #define isinf(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
82 | ||
83 | #ifdef isnan | |
84 | #undef isnan | |
85 | #endif | |
86 | ||
87 | #define isnan(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
88 | ||
89 | #ifdef isnormal | |
90 | #undef isnormal | |
91 | #endif | |
92 | ||
93 | #define isnormal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
94 | ||
95 | #ifdef signbit | |
96 | #undef signbit | |
97 | #endif | |
98 | ||
99 | #define signbit(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
100 | ||
101 | #ifdef isgreater | |
102 | #undef isgreater | |
103 | #endif | |
104 | ||
105 | #define isgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
106 | ||
107 | #ifdef isgreaterequal | |
108 | #undef isgreaterequal | |
109 | #endif | |
110 | ||
111 | #define isgreaterequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
112 | ||
113 | #ifdef isless | |
114 | #undef isless | |
115 | #endif | |
116 | ||
117 | #define isless(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
118 | ||
119 | #ifdef islessequal | |
120 | #undef islessequal | |
121 | #endif | |
122 | ||
123 | #define islessequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
124 | ||
125 | #ifdef islessgreater | |
126 | #undef islessgreater | |
127 | #endif | |
128 | ||
129 | #define islessgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
130 | ||
131 | #ifdef isunordered | |
132 | #undef isunordered | |
133 | #endif | |
134 | ||
135 | #define isunordered(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}} | |
136 | ||
137 | #endif | |
138 |