[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

config.hxx
1 /************************************************************************/
2 /* */
3 /* Copyright 1998-2002 by Ullrich Koethe */
4 /* */
5 /* This file is part of the VIGRA computer vision library. */
6 /* The VIGRA Website is */
7 /* http://hci.iwr.uni-heidelberg.de/vigra/ */
8 /* Please direct questions, bug reports, and contributions to */
9 /* ullrich.koethe@iwr.uni-heidelberg.de or */
10 /* vigra@informatik.uni-hamburg.de */
11 /* */
12 /* Permission is hereby granted, free of charge, to any person */
13 /* obtaining a copy of this software and associated documentation */
14 /* files (the "Software"), to deal in the Software without */
15 /* restriction, including without limitation the rights to use, */
16 /* copy, modify, merge, publish, distribute, sublicense, and/or */
17 /* sell copies of the Software, and to permit persons to whom the */
18 /* Software is furnished to do so, subject to the following */
19 /* conditions: */
20 /* */
21 /* The above copyright notice and this permission notice shall be */
22 /* included in all copies or substantial portions of the */
23 /* Software. */
24 /* */
25 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND */
26 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES */
27 /* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND */
28 /* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT */
29 /* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */
30 /* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING */
31 /* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR */
32 /* OTHER DEALINGS IN THE SOFTWARE. */
33 /* */
34 /************************************************************************/
35 
36 
37 #ifndef VIGRA_CONFIG_HXX
38 #define VIGRA_CONFIG_HXX
39 
40 #include <vigra/configVersion.hxx>
41 #include <stdexcept>
42 
43 ///////////////////////////////////////////////////////////
44 // //
45 // VisualC++ 5.0 //
46 // //
47 ///////////////////////////////////////////////////////////
48 
49 #ifdef _MSC_VER
50  #if(_MSC_VER < 1100) // before VisualC++ 5.0
51  #error "Need VisualC++ 5.0, Service Pack 2, or later"
52  #endif // _MSC_VER < 1100
53 
54  #if (_MSC_VER < 1300)
55  #define NO_TYPENAME // no 'typename' keyword
56  #define TEMPLATE_COPY_CONSTRUCTOR_BUG
57  #define NO_STL_MEMBER_TEMPLATES
58  #define NO_INLINE_STATIC_CONST_DEFINITION
59  #define CMATH_NOT_IN_STD
60  #define NO_COVARIANT_RETURN_TYPES
61 
62  #ifdef VIGRA_NO_STD_MINMAX // activate if necessary
63  namespace std {
64 
65  template<class T>
66  const T& min(const T& x, const T& y)
67  {
68  return (y < x)
69  ? y
70  : x;
71  }
72 
73  template<class T>
74  const T& max(const T& x, const T& y)
75  {
76  return (x < y)
77  ? y
78  : x;
79  }
80  }
81  #endif // VIGRA_NO_STD_MINMAX
82  #endif // (_MSC_VER < 1300)
83 
84  #if _MSC_VER < 1310
85  #pragma warning( disable : 4786 4250 4244 4305)
86 
87  #define NO_PARTIAL_TEMPLATE_SPECIALIZATION
88  #define NO_OUT_OF_LINE_MEMBER_TEMPLATES
89  #include <cmath>
90 
91  #ifdef _MSC_EXTENSIONS
92  #ifndef CMATH_NOT_IN_STD
93  namespace std {
94  #endif // CMATH_NOT_IN_STD
95  inline double abs(double v) { return fabs(v); }
96  inline float abs(float v) { return fabs(v); }
97  #ifndef CMATH_NOT_IN_STD
98  }
99  #endif // CMATH_NOT_IN_STD
100  #endif // _MSC_EXTENSIONS
101  #endif // _MSC_VER < 1310
102 
103  #if _MSC_VER < 1400
104  #define VIGRA_NO_WORKING_STRINGSTREAM
105  #endif
106 
107  #if _MSC_VER >= 1600
108  #define VIGRA_HAS_UNIQUE_PTR
109  #endif
110 
111  #define VIGRA_NEED_BIN_STREAMS
112 
113  #ifndef VIGRA_ENABLE_ANNOYING_WARNINGS
114  #pragma warning ( disable: 4244 4267) // implicit integer conversion warnings
115  #endif
116 
117  #ifdef VIGRA_DLL
118  #define VIGRA_EXPORT __declspec(dllexport)
119  #elif defined(VIGRA_STATIC_LIB)
120  #define VIGRA_EXPORT
121  #else
122  #define VIGRA_EXPORT __declspec(dllimport)
123  #endif
124 #endif // _MSC_VER
125 
126 ///////////////////////////////////////////////////////////
127 // //
128 // gcc //
129 // //
130 ///////////////////////////////////////////////////////////
131 
132 #if defined(__GNUC__)
133  #if __GNUC__ < 2 || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 8))
134  #error "Need at least g++ 2.95"
135  #endif
136  #if __GNUC__ < 3
137  #define VIGRA_NO_WORKING_STRINGSTREAM
138  #endif
139  #define HAS_HASH_CONTAINERS
140 
141  // these warnings produce too many false positives to be useful
142  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
143  #pragma GCC diagnostic ignored "-Wshadow"
144 
145  #if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
146  #define VIGRA_HAS_UNIQUE_PTR
147  #endif
148 
149 #endif // __GNUC__
150 
151 ///////////////////////////////////////////////////////////
152 // //
153 // MingW //
154 // //
155 ///////////////////////////////////////////////////////////
156 
157 #if defined(__MINGW32__)
158  #define VIGRA_NEED_BIN_STREAMS
159 
160  #ifdef VIGRA_DLL
161  #define VIGRA_EXPORT __declspec(dllexport)
162  #elif defined(VIGRA_STATIC_LIB)
163  #define VIGRA_EXPORT
164  #else
165  #define VIGRA_EXPORT __declspec(dllimport)
166  #endif
167 #endif // __MINGW32__
168 
169 ///////////////////////////////////////////////////////////
170 // //
171 // SGI C++ 7.2 //
172 // //
173 ///////////////////////////////////////////////////////////
174 
175 #if defined(__sgi) && !defined(__GNUC__)
176  #if _COMPILER_VERSION < 720
177  #error "Need SGI C++ 7.2 or later"
178  #endif
179  #if (_COMPILER_VERSION == 720) || (_COMPILER_VERSION == 721)
180  #define SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
181 
182  namespace vigra {
183  typedef std::exception StdException; // must be above next #define !!
184  }
185  #define std
186  #define NO_NAMESPACE_STD
187  #endif // _COMPILER_VERSION
188  #define HAS_HASH_CONTAINERS
189 #endif // __sgi
190 
191 ///////////////////////////////////////////////////////////
192 // //
193 // Sun C++ ??? //
194 // //
195 ///////////////////////////////////////////////////////////
196 
197 #if defined(__sun) && !defined(__GNUC__)
198  #define VIGRA_HAS_ERF
199 #endif // __sun
200 
201 ///////////////////////////////////////////////////////////
202 // //
203 // general //
204 // //
205 ///////////////////////////////////////////////////////////
206 
207 #ifdef CMATH_NOT_IN_STD
208  #define VIGRA_CSTD
209 #else
210  #define VIGRA_CSTD std
211 #endif
212 
213 #ifdef NO_TYPENAME
214  #define typename
215 #endif
216 
217 #ifdef NO_EXPLICIT
218  #define explicit
219 #endif
220 
221 #ifndef VIGRA_EXPORT
222  #define VIGRA_EXPORT
223 #endif
224 
225 #ifdef VIGRA_HAS_UNIQUE_PTR
226 # define VIGRA_UNIQUE_PTR std::unique_ptr
227 #else
228 # define VIGRA_UNIQUE_PTR std::auto_ptr
229 #endif
230 
231 namespace vigra {
232 
233 #ifndef SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
234  typedef std::exception StdException;
235 #endif
236 
237 } // namespace vigra
238 
239 #ifdef DOXYGEN
240 # define doxygen_overloaded_function(fun) fun(...);
241 #else
242 # define doxygen_overloaded_function(fun)
243 #endif
244 
245 
246 #endif // VIGRA_CONFIG_HXX
FFTWComplex< R >::NormType abs(const FFTWComplex< R > &a)
absolute value (= magnitude)
Definition: fftw3.hxx:1002

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.9.0 (Sun Aug 10 2014)