Fix compilation errors with isnan/isinf using Cygwin's GCC
This commit is contained in:
parent
13259299ba
commit
44847515ca
1 changed files with 12 additions and 1 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue