From 8048e6297ccbbfa861d456aeb4ae615771842822 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 2 Dec 2004 15:00:26 +0000 Subject: [PATCH] Martin Spott: Revised handling of missing isnan() on earlier versions of FreeBSD. --- simgear/scene/sky/cloud.cxx | 7 +++++-- simgear/sound/soundmgr_openal.cxx | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/simgear/scene/sky/cloud.cxx b/simgear/scene/sky/cloud.cxx index d4557064..dbc7d03d 100644 --- a/simgear/scene/sky/cloud.cxx +++ b/simgear/scene/sky/cloud.cxx @@ -46,11 +46,14 @@ inline int (isnan)(double r) { return isnan(r); } #endif #if defined (__FreeBSD__) -inline int isnan(double r) { return !(r <= 0 || r >= 0); } +# if __FreeBSD_version < 500000 + extern "C" { + inline int isnan(double r) { return !(r <= 0 || r >= 0); } + } +# endif #endif - static ssgStateSelector *layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES]; static bool state_initialized = false; static bool bump_mapping = false; diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index e9e2dfbc..9ec8355d 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -46,6 +46,15 @@ inline int (isnan)(double r) { return isnan(r); } #define isnan(x) _isnan(x) #endif +#if defined (__FreeBSD__) +# if __FreeBSD_version < 500000 + extern "C" { + inline int isnan(double r) { return !(r <= 0 || r >= 0); } + } +# endif +#endif + + #if defined (__FreeBSD__) inline int isnan(double r) { return !(r <= 0 || r >= 0); } #endif