]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/AIShip.cxx
commradio: improvements for atis speech
[flightgear.git] / src / AIModel / AIShip.cxx
index fed867be11a9ca77f7f605f9acfb9a881bb90ac2..d82c3963db4b708a5e0097f3f5a0d50a82d1e5fc 100644 (file)
 #  include <config.h>
 #endif
 
+#include <cmath>
+
 #ifdef _MSC_VER
 #  include <float.h>
-#  define finite _finite
-#elif defined(__sun) || defined(sgi)
-#  include <ieeefp.h>
+    double fgIsFinite(double x) { return _finite(x); }
+#else
+    double fgIsFinite(double x) { return std::isfinite(x); }
 #endif
 
-#include <math.h>
-
 #include <simgear/sg_inlines.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/timing/sg_time.hxx>
@@ -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 (fgIsFinite(_course))
         TurnTo(_course);
     else
         SG_LOG(SG_AI, SG_ALERT, "AIShip: Bearing or Range is not a finite number");