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 #ifndef _SCL_SECURE_NO_WARNINGS
00049 #define _SCL_SECURE_NO_WARNINGS
00050 #endif
00051 #pragma warning(disable:4996)
00052
00053 #if !defined(_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES)
00054 #define _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES 1
00055 #endif
00056 #endif
00057 #endif
00058
00059
00060 #if defined(MRPT_OS_WINDOWS) && !defined(NOMINMAX)
00061 # define NOMINMAX
00062 # ifdef max
00063 # undef max
00064 # undef min
00065 # endif
00066 #endif
00067
00068
00069
00070
00071 #if defined(_MSC_VER) && (_MSC_VER<1300)
00072 # ifndef max
00073 namespace std
00074 {
00075 template<class T> inline const T max(const T& A,const T& B) { return A>B ? A:B; }
00076 template<class T> inline const T min(const T& A,const T& B) { return A<B ? A:B; }
00077 }
00078 # else
00079 # define MAX3_MSVC6_VERSION
00080 # endif
00081 #endif
00082
00083
00084 #ifndef MAX3_MSVC6_VERSION
00085 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) ); }
00086 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) ); }
00087 #else
00088 # define max3(A,B,C) max(A,max(B,C))
00089 # define min3(A,B,C) min(A,min(B,C))
00090 #endif
00091
00092
00093 #if defined(_DEBUG) && defined(_MSC_VER) && (_MSC_VER>=1400)
00094 #define _CRTDBG_MAP_ALLOC
00095 #include <stdlib.h>
00096 #include <crtdbg.h>
00097 #endif
00098