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