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

vigra/config.hxx

00001 /************************************************************************/
00002 /*                                                                      */
00003 /*               Copyright 1998-2002 by Ullrich Koethe                  */
00004 /*       Cognitive Systems Group, University of Hamburg, Germany        */
00005 /*                                                                      */
00006 /*    This file is part of the VIGRA computer vision library.           */
00007 /*    The VIGRA Website is                                              */
00008 /*        http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/      */
00009 /*    Please direct questions, bug reports, and contributions to        */
00010 /*        ullrich.koethe@iwr.uni-heidelberg.de    or                    */
00011 /*        vigra@informatik.uni-hamburg.de                               */
00012 /*                                                                      */
00013 /*    Permission is hereby granted, free of charge, to any person       */
00014 /*    obtaining a copy of this software and associated documentation    */
00015 /*    files (the "Software"), to deal in the Software without           */
00016 /*    restriction, including without limitation the rights to use,      */
00017 /*    copy, modify, merge, publish, distribute, sublicense, and/or      */
00018 /*    sell copies of the Software, and to permit persons to whom the    */
00019 /*    Software is furnished to do so, subject to the following          */
00020 /*    conditions:                                                       */
00021 /*                                                                      */
00022 /*    The above copyright notice and this permission notice shall be    */
00023 /*    included in all copies or substantial portions of the             */
00024 /*    Software.                                                         */
00025 /*                                                                      */
00026 /*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
00027 /*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
00028 /*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
00029 /*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
00030 /*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
00031 /*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
00032 /*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
00033 /*    OTHER DEALINGS IN THE SOFTWARE.                                   */                
00034 /*                                                                      */
00035 /************************************************************************/
00036 
00037 
00038 #ifndef VIGRA_CONFIG_HXX
00039 #define VIGRA_CONFIG_HXX
00040 
00041 #include <stdexcept>
00042 
00043 ///////////////////////////////////////////////////////////
00044 //                                                       //
00045 //                   VisualC++ 5.0                       //
00046 //                                                       //
00047 ///////////////////////////////////////////////////////////
00048 
00049 #ifdef _MSC_VER
00050     #if(_MSC_VER < 1100)    // before VisualC++ 5.0
00051         #error "Need VisualC++ 5.0, Service Pack 2, or later"
00052     #endif // _MSC_VER < 1100
00053 
00054     #pragma warning( disable : 4786 4250 4244 4305)
00055 
00056     #if (_MSC_VER < 1300)
00057         #define NO_TYPENAME         // no 'typename' keyword
00058         #define TEMPLATE_COPY_CONSTRUCTOR_BUG
00059         #define NO_STL_MEMBER_TEMPLATES
00060         #define NO_INLINE_STATIC_CONST_DEFINITION
00061         #define CMATH_NOT_IN_STD
00062         #define NO_COVARIANT_RETURN_TYPES
00063 
00064         #ifdef VIGRA_NO_STD_MINMAX  // activate if necessary
00065         namespace std {
00066 
00067         template<class T>
00068         const T& min(const T& x, const T& y)
00069         {
00070             return (y < x)
00071                 ? y
00072                 : x;
00073         }
00074 
00075         template<class T>
00076         const T& max(const T& x, const T& y)
00077         {
00078             return (x < y)
00079                 ? y
00080                 : x;
00081         }
00082         }
00083         #endif // VIGRA_NO_STD_MINMAX
00084     #endif // (_MSC_VER < 1300)
00085 
00086     #if _MSC_VER < 1310
00087         #define NO_PARTIAL_TEMPLATE_SPECIALIZATION
00088         #define NO_OUT_OF_LINE_MEMBER_TEMPLATES
00089         #include <cmath>
00090 
00091         #ifdef _MSC_EXTENSIONS
00092         #ifndef CMATH_NOT_IN_STD
00093                 namespace std {
00094         #endif // CMATH_NOT_IN_STD
00095                 inline double abs(double v) { return fabs(v); }
00096                 inline float  abs(float v)  { return fabs(v); }
00097         #ifndef CMATH_NOT_IN_STD
00098                 }
00099         #endif // CMATH_NOT_IN_STD
00100         #endif // _MSC_EXTENSIONS
00101     #endif // _MSC_VER < 1310
00102 
00103     #if _MSC_VER < 1400
00104         #define VIGRA_NO_WORKING_STRINGSTREAM
00105     #endif
00106     
00107     #define VIGRA_NEED_BIN_STREAMS
00108 
00109     #ifdef VIGRA_DLL
00110         #define VIGRA_EXPORT __declspec(dllexport)
00111     #elif defined(VIGRA_STATIC_LIB)
00112         #define VIGRA_EXPORT
00113     #else
00114         #define VIGRA_EXPORT __declspec(dllimport)
00115     #endif
00116 #endif // _MSC_VER
00117 
00118 ///////////////////////////////////////////////////////////
00119 //                                                       //
00120 //                           gcc                         //
00121 //                                                       //
00122 ///////////////////////////////////////////////////////////
00123 
00124 #if defined(__GNUC__)
00125     #if  __GNUC__ < 2 || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 8))
00126         #error "Need at least g++ 2.95"
00127     #endif
00128     #if __GNUC__ < 3
00129         #define VIGRA_NO_WORKING_STRINGSTREAM
00130     #endif
00131     #define HAS_HASH_CONTAINERS
00132 #endif  // __GNUC__
00133 
00134 ///////////////////////////////////////////////////////////
00135 //                                                       //
00136 //                         MingW                         //
00137 //                                                       //
00138 ///////////////////////////////////////////////////////////
00139 
00140 #if defined(__MINGW32__)
00141     #define VIGRA_NEED_BIN_STREAMS
00142 
00143     #ifdef VIGRA_DLL
00144         #define VIGRA_EXPORT __declspec(dllexport)
00145     #elif defined(VIGRA_STATIC_LIB)
00146         #define VIGRA_EXPORT
00147     #else
00148         #define VIGRA_EXPORT __declspec(dllimport)
00149     #endif
00150 #endif  // __MINGW32__
00151 
00152 ///////////////////////////////////////////////////////////
00153 //                                                       //
00154 //                      SGI C++ 7.2                      //
00155 //                                                       //
00156 ///////////////////////////////////////////////////////////
00157 
00158 #if defined(__sgi) && !defined(__GNUC__)
00159     #if _COMPILER_VERSION < 720
00160         #error "Need SGI C++ 7.2 or later"
00161     #endif
00162     #if (_COMPILER_VERSION  == 720) || (_COMPILER_VERSION  == 721)
00163         #define SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
00164 
00165         namespace vigra {
00166             typedef std::exception StdException; // must be above next #define !!
00167         }
00168         #define std
00169         #define NO_NAMESPACE_STD
00170     #endif // _COMPILER_VERSION
00171     #define HAS_HASH_CONTAINERS
00172 #endif // __sgi
00173 
00174 ///////////////////////////////////////////////////////////
00175 //                                                       //
00176 //                      Sun C++ ???                      //
00177 //                                                       //
00178 ///////////////////////////////////////////////////////////
00179 
00180 #if defined(__sun) && !defined(__GNUC__)
00181     #define VIGRA_HAS_ERF
00182 #endif // __sun
00183 
00184 ///////////////////////////////////////////////////////////
00185 //                                                       //
00186 //                        general                        //
00187 //                                                       //
00188 ///////////////////////////////////////////////////////////
00189 
00190 #ifdef CMATH_NOT_IN_STD
00191     #define VIGRA_CSTD
00192 #else
00193     #define VIGRA_CSTD std
00194 #endif
00195 
00196 #ifdef NO_TYPENAME
00197     #define typename
00198 #endif
00199 
00200 #ifdef NO_EXPLICIT
00201     #define explicit
00202 #endif
00203 
00204 #ifndef VIGRA_EXPORT
00205     #define VIGRA_EXPORT
00206 #endif
00207 
00208 namespace vigra {
00209 
00210 #ifndef SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
00211      typedef std::exception StdException;
00212 #endif
00213 
00214 } // namespace vigra
00215 
00216 #ifdef DOXYGEN
00217 #  define doxygen_overloaded_function(fun) fun(...);
00218 #else
00219 #  define doxygen_overloaded_function(fun)
00220 #endif
00221 
00222 
00223 #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.6.0 (5 Nov 2009)