]> git.mxchange.org Git - flightgear.git/commitdiff
Various SGI portability tweaks.
authorcurt <curt>
Thu, 7 Oct 1999 23:08:48 +0000 (23:08 +0000)
committercurt <curt>
Thu, 7 Oct 1999 23:08:48 +0000 (23:08 +0000)
src/FDM/JSBSim/FGAircraft.cpp
src/FDM/JSBSim/FGUtility.h
src/FDM/JSBSim/JSBSim.cpp
src/Include/compiler.h
src/Main/options.cxx
src/Time/geocoord.h
src/Time/moonpos.cxx
src/Time/mymath.h

index e165cbe0e000b48faec16dcf708a830d8a939038..bdcd53c4bf54d5d076e0a8299bc5131f81bd0337 100644 (file)
@@ -168,7 +168,7 @@ bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string f
   while (!aircraftfile.fail()) {
        holding_string.erase();
     aircraftfile >> holding_string;
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__) || defined(FG_HAVE_NATIVE_SGI_COMPILERS)
     if (holding_string.compare(0, 2, "//") != 0) {
 #else
     if (holding_string.compare("//",0,2) != 0) {
@@ -273,8 +273,8 @@ bool FGAircraft::LoadAircraft(string aircraft_path, string engine_path, string f
            aircraftfile >> tag;
          gpos = aircraftfile.tellg();
                                aircraftfile >> tag;
-                               if (tag != "}" ) {
-                                       while (tag != "}") {
+                               if ( !(tag == "}") ) {
+                                       while ( !(tag == "}") ) {
                                                aircraftfile.seekg(gpos);
                    Coeff[axis][coeff_ctr[axis]] = new FGCoefficient(FDMExec, aircraftfile);
                          coeff_ctr[axis]++;
@@ -321,6 +321,7 @@ void FGAircraft::MassChange()
 {
   float Xt, Xw, Yt, Yw, Zt, Zw, Tw;
   float IXXt, IYYt, IZZt, IXZt;
+  int t;
 
   // UPDATE TANK CONTENTS
   //
@@ -335,7 +336,7 @@ void FGAircraft::MassChange()
 
   for (int e=0; e<numEngines; e++) {
     Fshortage = Oshortage = 0.0;
-    for (int t=0; t<numTanks; t++) {
+    for (t=0; t<numTanks; t++) {
       switch(Engine[e]->GetType()) {
       case FGEngine::etRocket:
 
@@ -371,7 +372,7 @@ void FGAircraft::MassChange()
   }
 
   Weight = EmptyWeight;
-  for (int t=0; t<numTanks; t++)
+  for (t=0; t<numTanks; t++)
     Weight += Tank[t]->GetContents();
 
   Mass = Weight / GRAVITY;
@@ -380,7 +381,7 @@ void FGAircraft::MassChange()
 
   Xt = Yt = Zt = 0;
   Xw = Yw = Zw = 0;
-  for (int t=0; t<numTanks; t++) {
+  for (t=0; t<numTanks; t++) {
     Xt += Tank[t]->GetX()*Tank[t]->GetContents();
     Yt += Tank[t]->GetY()*Tank[t]->GetContents();
     Zt += Tank[t]->GetZ()*Tank[t]->GetContents();
@@ -395,7 +396,7 @@ void FGAircraft::MassChange()
   // Calculate new moments of inertia here
 
   IXXt = IYYt = IZZt = IXZt = 0.0;
-  for (int t=0; t<numTanks; t++) {
+  for (t=0; t<numTanks; t++) {
     IXXt += ((Tank[t]->GetX()-Xcg)/12.0)*((Tank[t]->GetX() - Xcg)/12.0)*Tank[t]->GetContents()/GRAVITY;
     IYYt += ((Tank[t]->GetY()-Ycg)/12.0)*((Tank[t]->GetY() - Ycg)/12.0)*Tank[t]->GetContents()/GRAVITY;
     IZZt += ((Tank[t]->GetZ()-Zcg)/12.0)*((Tank[t]->GetZ() - Zcg)/12.0)*Tank[t]->GetContents()/GRAVITY;
index 142e33d3f03bd405f7e59360367367407e98f3c5..6af87c2bb8330a78e59f40b8b8d366123bfda087 100644 (file)
@@ -42,7 +42,9 @@ INCLUDES
 DEFINES
 *******************************************************************************/
 
+#ifndef FGFS
 using namespace std;
+#endif
 
 /*******************************************************************************
 CLASS DECLARATION
index 3e38cab84ff64b017b9277c9240cb329f678bedb..b8922d5e06c1c54eafb065c33fcb32d0de22237d 100644 (file)
@@ -75,8 +75,18 @@ INCLUDES
 #include "FGAuxiliary.h"
 #include "FGOutput.h"
 
+#ifdef FGFS
+#include <Include/compiler.h>
+#include STL_IOSTREAM
+#  ifdef FG_HAVE_STD_INCLUDES
+#    include <ctime>
+#  else
+#    include <time.h>
+#  endif
+#else
 #include <iostream>
 #include <ctime>
+#endif
 
 int main(int argc, char** argv)
 {
@@ -114,6 +124,8 @@ int main(int argc, char** argv)
   return 0;
 }
 
+#ifndef FGFS
 WinMain()
 {
 }
+#endif
index 95fd8afcb00447e32f312e611f522c3bdefbd06b..6ffa15bcb0cf7851c12721b70061b549ed6ca13a 100644 (file)
@@ -57,6 +57,7 @@
 #      define STL_FUNCTIONAL <functional>
 #      define STL_IOMANIP    <iomanip.h>
 #      define STL_IOSTREAM   <iostream.h>
+#      define STL_FSTREAM    <fstream.h>
 #      define STL_STDEXCEPT  <stdexcept>
 #      define STL_STRING     <string>
 #      define STL_STRSTREAM  <strstream.h>
@@ -81,6 +82,7 @@
 #      define STL_FUNCTIONAL <functional>
 #      define STL_IOMANIP    <iomanip>
 #      define STL_IOSTREAM   <iostream>
+#      define STL_FSTREAM    <fstream>
 #      define STL_STDEXCEPT  <stdexcept>
 #      define STL_STRING     <string>
 #      define STL_STRSTREAM  <strstream>
 #  define STL_FUNCTIONAL <functional>
 #  define STL_IOMANIP    <iomanip>
 #  define STL_IOSTREAM   <iostream>
+#  define STL_FSTREAM    <fstream>
 #  define STL_STDEXCEPT  <stdexcept>
 #  define STL_STRING     <string>
 
 #    define STL_FUNCTIONAL <functional>
 #    define STL_IOMANIP    <iomanip>
 #    define STL_IOSTREAM   <iostream>
+#    define STL_FSTREAM    <fstream>
 #    define STL_STDEXCEPT  <stdexcept>
 #    define STL_STRING     <string>
 #    define STL_STRSTREAM  <strstream>
 # endif // HAVE_SGI_STL_PORT
 
 #  define STL_IOSTREAM   <iostream>
+#  define STL_FSTREAM    <fstream>
 #  define STL_STRING     <string>
 #  define FG_NO_DEFAULT_TEMPLATE_ARGS
 #  define FG_NAMESPACES
 
 #  define STL_ALGORITHM  <algorithm>
 #  define STL_FUNCTIONAL <functional>
-#  define STL_IOMANIP    <iomanip>
+#  define STL_IOMANIP    <iomanip.h>
 #  define STL_IOSTREAM   <iostream.h>
+#  define STL_FSTREAM    <fstream.h>
 #  define STL_STDEXCEPT  <stdexcept>
 #  define STL_STRING     <string>
 #  define STL_STRSTREAM  <strstream>
index e904e2747084ab77d41bd026144167189f0aa00b..2ac9cb0caaceb5dc0a754351695241b6515bb9ef 100644 (file)
@@ -38,12 +38,12 @@ bool global_fullscreen = true;
 
 #include STL_STRING
 
+#include <Debug/logstream.hxx>
+#include <Misc/fgstream.hxx>
 #include <Include/fg_constants.h>
 #include <Include/general.hxx>
 #include <Cockpit/cockpit.hxx>
-#include <Debug/logstream.hxx>
 #include <FDM/flight.hxx>
-#include <Misc/fgstream.hxx>
 #ifdef FG_NETWORK_OLK
 #  include <Network/network.h>
 #endif
index 6549802538abe7cb807a37a55d221f9fc2804c5f..c38bab71268f57186dc5736b24b145dbbc450756 100644 (file)
 #ifndef _GEOCOORD_H_
 #define _GEOCOORD_H_
 
-//#include <stl.h>
+#include <Include/compiler.h>
 
 
 #include <math.h>
 #include <string>
-#include <iostream>
+#include STL_IOSTREAM
 //#include <streambuf> // looks like streambuf does not exist on linux.
 // But it looks like it isn't used anyways -:)
 #include <vector>
 
-using namespace std;
+FG_USING_NAMESPACE(std);
 
 #include "mymath.h"
 
index eb0fe7d57332dc51c1447202ac17fcb0b732f0de..e32df4ac1ed7a50714c3106e2fefc8bc74ed68b1 100644 (file)
@@ -51,9 +51,8 @@
 #endif
 
 
-//#include <Astro/orbits.hxx>
-#include <Astro/solarsystem.hxx>
 #include <Debug/logstream.hxx>
+#include <Astro/solarsystem.hxx>
 #include <Include/fg_constants.h>
 #include <Main/views.hxx>
 #include <Math/fg_geodesy.hxx>
index 8d1c5a9a40bd78c88fe56165f80c649f79161996..f2bbbf87652a9a60a2d687ebabca853d32cf921c 100755 (executable)
 
 #ifndef _MY_MATH_H_
 #define _MY_MATH_H__
+
+#include <Include/compiler.h>
+
 #include <math.h>
-#include <fstream>
-#include <iomanip>
+#include STL_FSTREAM
+#include STL_IOMANIP
 
-using namespace std;
+// FG_USING_NAMESPACE(std);
 
 #include <fg_constants.h>
 extern const  double PiOver180;