From 1ccf8516d9b8494201dc071fcf92cb2e04e9c965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20D=C3=B6singer?= Date: Fri, 30 Jul 2010 06:32:04 +0200 Subject: [PATCH 5/6] libport: Add msvc isnan and isinf implementations --- libs/port/isinf.c | 8 ++++++++ libs/port/isnan.c | 8 ++++++++ 2 files changed, 16 insertions(+), 0 deletions(-) diff --git a/libs/port/isinf.c b/libs/port/isinf.c index e0c35ad..70a6f6c 100644 --- a/libs/port/isinf.c +++ b/libs/port/isinf.c @@ -31,6 +31,14 @@ int isinf(double x) return (!(finite(x) || isnand(x))); } +#elif defined(HAVE_FLOAT_H) && defined(_MSC_VER) +#include + +int isinf(double x) +{ + return (!(_finite(x) || _isnan(x))); +} + #else #error No isinf() implementation available. #endif diff --git a/libs/port/isnan.c b/libs/port/isnan.c index b2a1be6..aee3daf 100644 --- a/libs/port/isnan.c +++ b/libs/port/isnan.c @@ -31,6 +31,14 @@ int isnan(double x) return isnand(x); } +#elif defined(HAVE_FLOAT_H) && defined(_MSC_VER) +#include + +int isnan(double x) +{ + return _isnan(x); +} + #else #error No isnan() implementation available. #endif -- 1.6.4.4