[ 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 #endif // __GNUC__
133 
134 ///////////////////////////////////////////////////////////
135 // //
136 // MingW //
137 // //
138 ///////////////////////////////////////////////////////////
139 
140 #if defined(__MINGW32__)
141  #define VIGRA_NEED_BIN_STREAMS
142 
143  #ifdef VIGRA_DLL
144  #define VIGRA_EXPORT __declspec(dllexport)
145  #elif defined(VIGRA_STATIC_LIB)
146  #define VIGRA_EXPORT
147  #else
148  #define VIGRA_EXPORT __declspec(dllimport)
149  #endif
150 #endif // __MINGW32__
151 
152 ///////////////////////////////////////////////////////////
153 // //
154 // SGI C++ 7.2 //
155 // //
156 ///////////////////////////////////////////////////////////
157 
158 #if defined(__sgi) && !defined(__GNUC__)
159  #if _COMPILER_VERSION < 720
160  #error "Need SGI C++ 7.2 or later"
161  #endif
162  #if (_COMPILER_VERSION == 720) || (_COMPILER_VERSION == 721)
163  #define SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
164 
165  namespace vigra {
166  typedef std::exception StdException; // must be above next #define !!
167  }
168  #define std
169  #define NO_NAMESPACE_STD
170  #endif // _COMPILER_VERSION
171  #define HAS_HASH_CONTAINERS
172 #endif // __sgi
173 
174 ///////////////////////////////////////////////////////////
175 // //
176 // Sun C++ ??? //
177 // //
178 ///////////////////////////////////////////////////////////
179 
180 #if defined(__sun) && !defined(__GNUC__)
181  #define VIGRA_HAS_ERF
182 #endif // __sun
183 
184 ///////////////////////////////////////////////////////////
185 // //
186 // general //
187 // //
188 ///////////////////////////////////////////////////////////
189 
190 #ifdef CMATH_NOT_IN_STD
191  #define VIGRA_CSTD
192 #else
193  #define VIGRA_CSTD std
194 #endif
195 
196 #ifdef NO_TYPENAME
197  #define typename
198 #endif
199 
200 #ifdef NO_EXPLICIT
201  #define explicit
202 #endif
203 
204 #ifndef VIGRA_EXPORT
205  #define VIGRA_EXPORT
206 #endif
207 
208 namespace vigra {
209 
210 #ifndef SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
211  typedef std::exception StdException;
212 #endif
213 
214 } // namespace vigra
215 
216 #ifdef DOXYGEN
217 # define doxygen_overloaded_function(fun) fun(...);
218 #else
219 # define doxygen_overloaded_function(fun)
220 #endif
221 
222 
223 #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.7.1 (Thu Jun 14 2012)