X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkPortability.h;h=ca16fcf5809fe5dd5d80c8f8da30a507edf92e24;hb=e534754cde3aee05927b1ca4aa6962dc05ee0322;hp=da1b7ba6c710a18e848b3f4fa906196763e6d0df;hpb=4a567a442ac0d844a894e5de071d51a505d07f4a;p=clitk.git diff --git a/common/clitkPortability.h b/common/clitkPortability.h index da1b7ba..ca16fcf 100755 --- a/common/clitkPortability.h +++ b/common/clitkPortability.h @@ -1,10 +1,23 @@ #ifndef CLITKPORTABILITY_H #define CLITKPORTABILITY_H - + +#if defined(WIN32) +# define _USE_MATH_DEFINES //Before math.h include (i.e. cmath) +#endif +#include + #if defined(WIN32) # define rint(x) floor(x+0.5) # define lrint(x) (long)rint(x) -# define _USE_MATH_DEFINES #endif +template +int IsNormal(const T val) { +#if defined(_MSC_VER) + return _finite(val); +#elif defined(unix) + return std::isnormal(val); +#endif +} + #endif /* end #define CLITKPORTABILITY_H */