00001 #ifndef FAITH_TOOLS_H
00002 #define FAITH_TOOLS_H
00003
00004 #include <algorithm>
00005
00006
00007 #ifdef WIN32
00008 # ifndef NOMINMAX
00009 # define NOMINMAX
00010 # endif
00011
00012 typedef unsigned int uint32_t;
00013 typedef unsigned short uint16_t;
00014 typedef signed int int32_t;
00015 typedef signed short int16_t;
00016 typedef unsigned int uint;
00017
00018
00019 # ifdef DLL_EXPORT
00020 # define FAITH_EXPORT __declspec(dllexport)
00021 # define FAITH_IMPORT __declspec(dllimport)
00022 # else
00023 # define FAITH_EXPORT
00024 # define FAITH_IMPORT
00025 # endif
00026
00027
00028 # ifndef __GNUC__
00029
00030 template<class T>
00031 inline static T faith_stupid_compiler_min(const T &left, const T &right)
00032 {
00033 return left< right ? left : right;
00034 }
00035
00036 template<class T>
00037 inline static T faith_stupid_compiler_max(const T &left, const T &right)
00038 {
00039 return left> right ? left : right;
00040 }
00041
00042 # define MAX faith_stupid_compiler_max
00043 # define MIN faith_stupid_compiler_min
00044
00045 # pragma warning(disable : 4786)
00046 # pragma warning(disable : 4275)
00047 # pragma warning(disable : 4251)
00048
00049 # else
00050
00051 # define MAX std::max
00052 # define MIN std::min
00053
00054 # include <algorithm>
00055 # endif // __GNUC__
00056
00057
00058 #else
00059
00060
00061 #ifdef DLL_EXPORT
00062 #define FAITH_EXPORT __attribute__ ((visibility("default")))
00063 #define FAITH_IMPORT
00064 #else
00065 #define FAITH_EXPORT
00066 #define FAITH_IMPORT
00067 #endif
00068
00069
00070 #include <algorithm>
00071
00072
00073 #define MAX std::max
00074 #define MIN std::min
00075 #include <stdint.h>
00076
00077 #endif
00078
00079 #ifdef FAITH_TOOLS_EXPORTS
00080 #define FAITH_TOOLS_EXPORT FAITH_EXPORT
00081 #else
00082 #define FAITH_TOOLS_EXPORT FAITH_IMPORT
00083 #endif
00084
00085 #endif
00086