1
0
Fork 0

Support non-C99 mode in MSVC.

This commit is contained in:
James Turner 2013-12-21 15:29:39 +00:00
parent 4c51ad0d87
commit c717b70231
2 changed files with 8 additions and 8 deletions

View file

@ -38,9 +38,9 @@
#ifdef _MSC_VER #ifdef _MSC_VER
# include <float.h> # include <float.h>
# define finite _finite # define isfinite(x) _finite(x)
#elif defined(__sun) || defined(sgi) #else
# include <ieeefp.h> # define isfinite(x) std::isfinite(x)
#endif #endif
@ -945,7 +945,7 @@ void FGAIAircraft::controlHeading(FGAIWaypoint* curr) {
SG_NORMALIZE_RANGE(calc_bearing, 0.0, 360.0); 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; double hdg_error = calc_bearing - tgt_heading;
if (fabs(hdg_error) > 0.01) { if (fabs(hdg_error) > 0.01) {
TurnTo( calc_bearing ); TurnTo( calc_bearing );

View file

@ -23,9 +23,9 @@
#ifdef _MSC_VER #ifdef _MSC_VER
# include <float.h> # include <float.h>
# define finite _finite # define isfinite(x) _finite(x)
#elif defined(__sun) || defined(sgi) #else
# include <ieeefp.h> # define isfinite(x) std::isfinite(x)
#endif #endif
#include <math.h> #include <math.h>
@ -792,7 +792,7 @@ void FGAIShip::ProcessFlightPlan(double dt) {
// now revise the required course for the next way point // now revise the required course for the next way point
_course = getCourse(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr->getLatitude(), curr->getLongitude()); _course = getCourse(pos.getLatitudeDeg(), pos.getLongitudeDeg(), curr->getLatitude(), curr->getLongitude());
if (std::isfinite(_course)) if (isfinite(_course))
TurnTo(_course); TurnTo(_course);
else else
SG_LOG(SG_AI, SG_ALERT, "AIShip: Bearing or Range is not a finite number"); SG_LOG(SG_AI, SG_ALERT, "AIShip: Bearing or Range is not a finite number");