Fix compilation errors with isnan/isinf using Cygwin's GCC

This commit is contained in:
Ray Speth 2014-02-20 03:00:56 +00:00
parent 13259299ba
commit 44847515ca

View file

@ -32,7 +32,7 @@ namespace Cantera {
void checkFinite(const double tmp)
{
#ifdef _WIN32
#if defined _WIN32
if (_finite(tmp)) {
if (_isnan(tmp)) {
printf("checkFinite() ERROR: we have encountered a nan!\n");
@ -43,6 +43,17 @@ void checkFinite(const double tmp)
}
throw std::range_error("checkFinite()");
}
#elif defined __CYGWIN__
if (!finite(tmp)) {
if (isnan(tmp)) {
printf("checkFinite() ERROR: we have encountered a nan!\n");
} else if (isinf(tmp) == 1) {
printf("checkFinite() ERROR: we have encountered a pos inf!\n");
} else {
printf("checkFinite() ERROR: we have encountered a neg inf!\n");
}
throw std::range_error("checkFinite()");
}
#else
if (!::finite(tmp)) {
if (::isnan(tmp)) {