Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef UTILSDEFS_H
00030 #error "This file is intended for include from utils_defs.h only!"
00031 #endif
00032
00033
00034
00035
00036 #if defined(_MSC_VER)
00037 #pragma warning(disable:4786) // (Compiler: Visual C++) Disable warning for too long debug names:
00038 #pragma warning(disable:4503) // (Compiler: Visual C++ 2010) Disable warning for too long decorated name
00039 #pragma warning(disable:4702) // (Compiler: Visual C++) Disable warning for unreachable code (I don't know why some of these errors appear in the STANDARD LIBRARY headers with Visual Studio 2003!):
00040 #pragma warning(disable:4244) // (Compiler: Visual C++) Conversion double->float
00041 #pragma warning(disable:4305)
00042 #pragma warning(disable:4267)
00043 #pragma warning(disable:4290) // Visual C++ does not implement decl. specifiers: throw(A,B,...)
00044 #pragma warning(disable:4251) // Visual C++ 2003+ warnings on STL classes when exporting to DLL...
00045 #pragma warning(disable:4275)
00046 #if (_MSC_VER >= 1400 )
00047
00048 #define _SCL_SECURE_NO_WARNINGS
00049 #pragma warning(disable:4996)
00050
00051 #if !defined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
00052 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
00053 #endif
00054 #endif
00055 #endif
00056
00057
00058 #if defined(MRPT_OS_WINDOWS) && !defined(NOMINMAX)
00059 # define NOMINMAX
00060 # ifdef max
00061 # undef max
00062 # undef min
00063 # endif
00064 #endif
00065
00066
00067
00068
00069 #if defined(_MSC_VER) && (_MSC_VER<1300)
00070 # ifndef max
00071 namespace std
00072 {
00073 template<class T> inline const T max(const T& A,const T& B) { return A>B ? A:B; }
00074 template<class T> inline const T min(const T& A,const T& B) { return A<B ? A:B; }
00075 }
00076 # else
00077 # define MAX3_MSVC6_VERSION
00078 # endif
00079 #endif
00080
00081
00082 #ifndef MAX3_MSVC6_VERSION
00083 template<typename T> inline const T min3(const T& A, const T& B,const T& C) { return std::min<T>(A, std::min<T>(B,C) ); }
00084 template<typename T> inline const T max3(const T& A, const T& B,const T& C) { return std::max<T>(A, std::max<T>(B,C) ); }
00085 #else
00086 # define max3(A,B,C) max(A,max(B,C))
00087 # define min3(A,B,C) min(A,min(B,C))
00088 #endif
00089
00090
00091 #if defined(_DEBUG) && defined(_MSC_VER) && (_MSC_VER>=1400)
00092 #define _CRTDBG_MAP_ALLOC
00093 #include <stdlib.h>
00094 #include <crtdbg.h>
00095 #endif
00096