]> Creatis software - clitk.git/blob - common/clitkPortability.h
*** empty log message ***
[clitk.git] / common / clitkPortability.h
1 #ifndef CLITKPORTABILITY_H
2 #define CLITKPORTABILITY_H
3
4 #if defined(WIN32)
5 #  define _USE_MATH_DEFINES //Before math.h include (i.e. cmath)
6 #endif
7 #include <cmath>
8
9 #if defined(WIN32)
10 #  define rint(x)  floor(x+0.5)
11 #  define lrint(x) (long)rint(x) 
12 #endif
13
14 template<typename T>
15 int IsNormal(const T val) {
16 #if defined(_MSC_VER)
17   return _finite(val);
18 #elif defined(unix)
19   return std::isnormal(val);
20 #endif
21 }
22
23 #endif /* end #define CLITKPORTABILITY_H */