• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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>
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 //
17 #include <boost/config.hpp>
18 #include <valarray>
19 #include <complex>
20 #include <iosfwd>
21 #include <sstream>
22 #include <ostream>
23 #include <istream>
24 #include <utility>
25 #include <iomanip>
26 #include <typeinfo>
27 #include <stdexcept>
28 #include <cstddef>
29 #include <string>
30 #include <cstring>
31 #include <cctype>
32 #include <limits>
33 #include <exception>
34 #include <iterator>
35 #include <numeric>
36 #include <vector>
37 #include <algorithm>
38 #include <typeinfo>
39 #include <memory>
40 #include <cerrno>
41 #include <functional>
42 #ifndef BOOST_NO_CXX11_HDR_FUTURE
43 #include <future>
44 #endif
45 #ifndef BOOST_NO_CXX11_HDR_THREAD
46 #include <thread>
47 #endif
48 #ifndef BOOST_NO_CXX11_HDR_RANDOM
49 #include <random>
50 #endif
51 #ifndef BOOST_NO_CXX11_HDR_CHRONO
52 #include <chrono>
53 #endif
54 #include <map>
55 
56 //
57 // We have to include this *before* poisoning the macros
58 // as it needs to be able to use them!
59 //
60 #include <boost/math/special_functions/fpclassify.hpp>
61 
62 //
63 // Poison all the function-like macros in C99 so if we accidentally call them
64 // in an unsafe manner, we'll get compiler errors.  Of course these shouldn't be
65 // macros in C++ at all...
66 //
67 
68 #ifdef fpclassify
69 #undef fpclassify
70 #endif
71 
72 #define fpclassify(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
73 
74 #ifdef isfinite
75 #undef isfinite
76 #endif
77 
78 #define isfinite(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
79 
80 #ifdef isinf
81 #undef isinf
82 #endif
83 
84 #define isinf(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
85 
86 #ifdef isnan
87 #undef isnan
88 #endif
89 
90 #define isnan(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
91 
92 #ifdef isnormal
93 #undef isnormal
94 #endif
95 
96 #define isnormal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
97 
98 #ifdef signbit
99 #undef signbit
100 #endif
101 
102 #define signbit(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
103 
104 #ifdef isgreater
105 #undef isgreater
106 #endif
107 
108 #define isgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
109 
110 #ifdef isgreaterequal
111 #undef isgreaterequal
112 #endif
113 
114 #define isgreaterequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
115 
116 #ifdef isless
117 #undef isless
118 #endif
119 
120 #define isless(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
121 
122 #ifdef islessequal
123 #undef islessequal
124 #endif
125 
126 #define islessequal(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
127 
128 #ifdef islessgreater
129 #undef islessgreater
130 #endif
131 
132 #define islessgreater(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
133 
134 #ifdef isunordered
135 #undef isunordered
136 #endif
137 
138 #define isunordered(x) this_should_not_compile(x)}}}}}}}}}}}}}}}}}}}
139 
140 #endif
141 
142