vigra - vigra/config.hxx Source File

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

vigra/config.hxx |

    00001 /************************************************************************/
    00002 /*                                                                      */
    00003 /*               Copyright 1998-2002 by Ullrich Koethe                  */
    00004 /*                                                                      */
    00005 /*    This file is part of the VIGRA computer vision library.           */
    00006 /*    The VIGRA Website is                                              */
    00007 /*        http://hci.iwr.uni-heidelberg.de/vigra/                       */
    00008 /*    Please direct questions, bug reports, and contributions to        */
    00009 /*        ullrich.koethe@iwr.uni-heidelberg.de    or                    */
    00010 /*        vigra@informatik.uni-hamburg.de                               */
    00011 /*                                                                      */
    00012 /*    Permission is hereby granted, free of charge, to any person       */
    00013 /*    obtaining a copy of this software and associated documentation    */
    00014 /*    files (the "Software"), to deal in the Software without           */
    00015 /*    restriction, including without limitation the rights to use,      */
    00016 /*    copy, modify, merge, publish, distribute, sublicense, and/or      */
    00017 /*    sell copies of the Software, and to permit persons to whom the    */
    00018 /*    Software is furnished to do so, subject to the following          */
    00019 /*    conditions:                                                       */
    00020 /*                                                                      */
    00021 /*    The above copyright notice and this permission notice shall be    */
    00022 /*    included in all copies or substantial portions of the             */
    00023 /*    Software.                                                         */
    00024 /*                                                                      */
    00025 /*    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND    */
    00026 /*    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES   */
    00027 /*    OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND          */
    00028 /*    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT       */
    00029 /*    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,      */
    00030 /*    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING      */
    00031 /*    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR     */
    00032 /*    OTHER DEALINGS IN THE SOFTWARE.                                   */
    00033 /*                                                                      */
    00034 /************************************************************************/
    00035
    00036
    00037 #ifndef VIGRA_CONFIG_HXX
    00038 #define VIGRA_CONFIG_HXX
    00039
    00040 #include <vigra/configVersion.hxx>
    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     #if (_MSC_VER < 1300)
    00055         #define NO_TYPENAME         // no 'typename' keyword
    00056         #define TEMPLATE_COPY_CONSTRUCTOR_BUG
    00057         #define NO_STL_MEMBER_TEMPLATES
    00058         #define NO_INLINE_STATIC_CONST_DEFINITION
    00059         #define CMATH_NOT_IN_STD
    00060         #define NO_COVARIANT_RETURN_TYPES
    00061
    00062         #ifdef VIGRA_NO_STD_MINMAX  // activate if necessary
    00063         namespace std {
    00064
    00065         template<class T>
    00066         const T& min(const T& x, const T& y)
    00067         {
    00068             return (y < x)
    00069                 ? y
    00070                 : x;
    00071         }
    00072
    00073         template<class T>
    00074         const T& max(const T& x, const T& y)
    00075         {
    00076             return (x < y)
    00077                 ? y
    00078                 : x;
    00079         }
    00080         }
    00081         #endif // VIGRA_NO_STD_MINMAX
    00082     #endif // (_MSC_VER < 1300)
    00083
    00084     #if _MSC_VER < 1310
    00085         #pragma warning( disable : 4786 4250 4244 4305)
    00086
    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     #if _MSC_VER >= 1600
    00108         #define VIGRA_HAS_UNIQUE_PTR
    00109     #endif
    00110
    00111     #define VIGRA_NEED_BIN_STREAMS
    00112
    00113     #ifndef VIGRA_ENABLE_ANNOYING_WARNINGS
    00114         #pragma warning ( disable: 4244 4267) // implicit integer conversion warnings
    00115     #endif
    00116
    00117     #ifdef VIGRA_DLL
    00118         #define VIGRA_EXPORT __declspec(dllexport)
    00119     #elif defined(VIGRA_STATIC_LIB)
    00120         #define VIGRA_EXPORT
    00121     #else
    00122         #define VIGRA_EXPORT __declspec(dllimport)
    00123     #endif
    00124 #endif // _MSC_VER
    00125
    00126 ///////////////////////////////////////////////////////////
    00127 //                                                       //
    00128 //                           gcc                         //
    00129 //                                                       //
    00130 ///////////////////////////////////////////////////////////
    00131
    00132 #if defined(__GNUC__)
    00133     #if  __GNUC__ < 2 || ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 8))
    00134         #error "Need at least g++ 2.95"
    00135     #endif
    00136     #if __GNUC__ < 3
    00137         #define VIGRA_NO_WORKING_STRINGSTREAM
    00138     #endif
    00139     #define HAS_HASH_CONTAINERS
    00140
    00141     // these warnings produce too many false positives to be useful
    00142     #pragma GCC diagnostic ignored "-Wstrict-aliasing"
    00143     #pragma GCC diagnostic ignored "-Wshadow"
    00144
    00145     #if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
    00146         #define VIGRA_HAS_UNIQUE_PTR
    00147     #endif
    00148
    00149 #endif  // __GNUC__
    00150
    00151 ///////////////////////////////////////////////////////////
    00152 //                                                       //
    00153 //                         MingW                         //
    00154 //                                                       //
    00155 ///////////////////////////////////////////////////////////
    00156
    00157 #if defined(__MINGW32__)
    00158     #define VIGRA_NEED_BIN_STREAMS
    00159
    00160     #ifdef VIGRA_DLL
    00161         #define VIGRA_EXPORT __declspec(dllexport)
    00162     #elif defined(VIGRA_STATIC_LIB)
    00163         #define VIGRA_EXPORT
    00164     #else
    00165         #define VIGRA_EXPORT __declspec(dllimport)
    00166     #endif
    00167 #endif  // __MINGW32__
    00168
    00169 ///////////////////////////////////////////////////////////
    00170 //                                                       //
    00171 //                      SGI C++ 7.2                      //
    00172 //                                                       //
    00173 ///////////////////////////////////////////////////////////
    00174
    00175 #if defined(__sgi) && !defined(__GNUC__)
    00176     #if _COMPILER_VERSION < 720
    00177         #error "Need SGI C++ 7.2 or later"
    00178     #endif
    00179     #if (_COMPILER_VERSION  == 720) || (_COMPILER_VERSION  == 721)
    00180         #define SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
    00181
    00182         namespace vigra {
    00183             typedef std::exception StdException; // must be above next #define !!
    00184         }
    00185         #define std
    00186         #define NO_NAMESPACE_STD
    00187     #endif // _COMPILER_VERSION
    00188     #define HAS_HASH_CONTAINERS
    00189 #endif // __sgi
    00190
    00191 ///////////////////////////////////////////////////////////
    00192 //                                                       //
    00193 //                      Sun C++ ???                      //
    00194 //                                                       //
    00195 ///////////////////////////////////////////////////////////
    00196
    00197 #if defined(__sun) && !defined(__GNUC__)
    00198     #define VIGRA_HAS_ERF
    00199 #endif // __sun
    00200
    00201 ///////////////////////////////////////////////////////////
    00202 //                                                       //
    00203 //                        general                        //
    00204 //                                                       //
    00205 ///////////////////////////////////////////////////////////
    00206
    00207 #ifdef CMATH_NOT_IN_STD
    00208     #define VIGRA_CSTD
    00209 #else
    00210     #define VIGRA_CSTD std
    00211 #endif
    00212
    00213 #ifdef NO_TYPENAME
    00214     #define typename
    00215 #endif
    00216
    00217 #ifdef NO_EXPLICIT
    00218     #define explicit
    00219 #endif
    00220
    00221 #ifndef VIGRA_EXPORT
    00222     #define VIGRA_EXPORT
    00223 #endif
    00224
    00225 #ifdef VIGRA_HAS_UNIQUE_PTR
    00226 #  define VIGRA_UNIQUE_PTR  std::unique_ptr
    00227 #else
    00228 #  define VIGRA_UNIQUE_PTR  std::auto_ptr
    00229 #endif
    00230
    00231 namespace vigra {
    00232
    00233 #ifndef SPECIAL_STDEXCEPTION_DEFINITION_NEEDED
    00234      typedef std::exception StdException;
    00235 #endif
    00236
    00237 } // namespace vigra
    00238
    00239 #ifdef DOXYGEN
    00240 #  define doxygen_overloaded_function(fun) fun(...);
    00241 #else
    00242 #  define doxygen_overloaded_function(fun)
    00243 #endif
    00244
    00245
    00246 #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.9.0 (Tue Nov 6 2012)