]> git.mxchange.org Git - flightgear.git/commitdiff
Support non-C99 mode in MSVC.
authorJames Turner <zakalawe@mac.com>
Sat, 21 Dec 2013 15:29:39 +0000 (15:29 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 21 Dec 2013 15:31:27 +0000 (15:31 +0000)
src/AIModel/AIAircraft.cxx
src/AIModel/AIShip.cxx

index bb54085bc659e4e1db96d3c5a41d6aa02a8f52d1..39642d76ed1bba72a5911336caa7116b985923ab 100644 (file)
@@ -38,9 +38,9 @@
 
 #ifdef _MSC_VER
 #  include <float.h>
-#  define finite _finite
-#elif defined(__sun) || defined(sgi)
-#  include <ieeefp.h>
+#  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 );
index fed867be11a9ca77f7f605f9acfb9a881bb90ac2..5d94dd28402570ceb8e80d5634c23ef8beb719bf 100644 (file)
@@ -23,9 +23,9 @@
 
 #ifdef _MSC_VER
 #  include <float.h>
-#  define finite _finite
-#elif defined(__sun) || defined(sgi)
-#  include <ieeefp.h>
+#  define isfinite(x) _finite(x)
+#else
+#  define isfinite(x) std::isfinite(x)
 #endif
 
 #include <math.h>
@@ -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");