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