From: James Turner Date: Sat, 21 Dec 2013 15:29:39 +0000 (+0000) Subject: Support non-C99 mode in MSVC. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c717b702318ab050006464023ecbc805a42f28e7;p=flightgear.git Support non-C99 mode in MSVC. --- diff --git a/src/AIModel/AIAircraft.cxx b/src/AIModel/AIAircraft.cxx index bb54085bc..39642d76e 100644 --- a/src/AIModel/AIAircraft.cxx +++ b/src/AIModel/AIAircraft.cxx @@ -38,9 +38,9 @@ #ifdef _MSC_VER # include -# define finite _finite -#elif defined(__sun) || defined(sgi) -# include +# define isfinite(x) _finite(x) +#else +# define isfinite(x) std::isfinite(x) #endif @@ -945,7 +945,7 @@ void FGAIAircraft::controlHeading(FGAIWaypoint* curr) { SG_NORMALIZE_RANGE(calc_bearing, 0.0, 360.0); } - if (std::isfinite(calc_bearing)) { + if (isfinite(calc_bearing)) { double hdg_error = calc_bearing - tgt_heading; if (fabs(hdg_error) > 0.01) { TurnTo( calc_bearing ); diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index fed867be1..5d94dd284 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -23,9 +23,9 @@ #ifdef _MSC_VER # include -# define finite _finite -#elif defined(__sun) || defined(sgi) -# include +# define isfinite(x) _finite(x) +#else +# define isfinite(x) std::isfinite(x) #endif #include @@ -792,7 +792,7 @@ void FGAIShip::ProcessFlightPlan(double dt) { // now revise the required course for the next way point _course = getCourse(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr->getLatitude(), curr->getLongitude()); - if (std::isfinite(_course)) + if (isfinite(_course)) TurnTo(_course); else SG_LOG(SG_AI, SG_ALERT, "AIShip: Bearing or Range is not a finite number");