[ 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  #define VIGRA_NEED_BIN_STREAMS
108 
109  #ifdef VIGRA_DLL
110  #define VIGRA_EXPORT __declspec(dllexport)
111  #elif defined(VIGRA_STATIC_LIB)
112  #define VIGRA_EXPORT
113  #else
114  #define VIGRA_EXPORT __declspec(dllimport)
115  #endif
116 #endif // _MSC_VER
117 
118 ///////////////////////////////////////////////////////////
119 // //
120 // gcc //
121 // //
122 ///////////////////////////////////////////////////////////
123 
124 #if defined(__GNUC__)
125  #if __GNUC__ < 2 || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 8))
126  #error "Need at least g++ 2.95"
127  #endif
128  #if __GNUC__ < 3
129  #define VIGRA_NO_WORKING_STRINGSTREAM
130  #endif
131  #define HAS_HASH_CONTAINERS
132 
133  // these warnings produce too many false positives to be useful
134  #pragma GCC diagnostic ignored "-Wstrict-aliasing"
135  #pragma GCC diagnostic ignored "-Wshadow"
136 
137 #endif // __GNUC__
138 
139 ///////////////////////////////////////////////////////////
140 // //
141 // MingW //
142 // //
143 ///////////////////////////////////////////////////////////
144 
145 #if defined(__MINGW32__)
146  #define VIGRA_NEED_BIN_STREAMS
147 
148  #ifdef VIGRA_DLL
149  #define VIGRA_EXPORT __declspec(dllexport)
150  #elif defined(VIGRA_STATIC_LIB)
151  #define VIGRA_EXPORT
152  #else
153  #define VIGRA_EXPORT __declspec(dllimport)
154  #endif
155 #endif // __MINGW32__
156 
157 ///////////////////////////////////////////////////////////
158 // //
159 // SGI C++ 7.2 //
160 // //
161 ///////////////////////////////////////////////////////////
162 
163 #if defined(__sgi) && !defined(__GNUC__)
164  #if _COMPILER_VERSION < 720
165  #error "Need SGI C++ 7.2 or later"
166  #endif
167  #if (_COMPILER_VERSION == 720) || (_COMPILER_VERSION == 721)
168  #define SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
169 
170  namespace vigra {
171  typedef std::exception StdException; // must be above next #define !!
172  }
173  #define std
174  #define NO_NAMESPACE_STD
175  #endif // _COMPILER_VERSION
176  #define HAS_HASH_CONTAINERS
177 #endif // __sgi
178 
179 ///////////////////////////////////////////////////////////
180 // //
181 // Sun C++ ??? //
182 // //
183 ///////////////////////////////////////////////////////////
184 
185 #if defined(__sun) && !defined(__GNUC__)
186  #define VIGRA_HAS_ERF
187 #endif // __sun
188 
189 ///////////////////////////////////////////////////////////
190 // //
191 // general //
192 // //
193 ///////////////////////////////////////////////////////////
194 
195 #ifdef CMATH_NOT_IN_STD
196  #define VIGRA_CSTD
197 #else
198  #define VIGRA_CSTD std
199 #endif
200 
201 #ifdef NO_TYPENAME
202  #define typename
203 #endif
204 
205 #ifdef NO_EXPLICIT
206  #define explicit
207 #endif
208 
209 #ifndef VIGRA_EXPORT
210  #define VIGRA_EXPORT
211 #endif
212 
213 namespace vigra {
214 
215 #ifndef SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
216  typedef std::exception StdException;
217 #endif
218 
219 } // namespace vigra
220 
221 #ifdef DOXYGEN
222 # define doxygen_overloaded_function(fun) fun(...);
223 #else
224 # define doxygen_overloaded_function(fun)
225 #endif
226 
227 
228 #endif // VIGRA_CONFIG_HXX

© 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.8.0 (Wed Sep 26 2012)