1
0
Fork 0

Various SGI portability tweaks.

This commit is contained in:
curt 1999-10-07 23:08:48 +00:00
parent f7af6787a0
commit f00b1f8b83
8 changed files with 42 additions and 19 deletions

View 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;

View file

@ -42,7 +42,9 @@ INCLUDES
DEFINES
*******************************************************************************/
#ifndef FGFS
using namespace std;
#endif
/*******************************************************************************
CLASS DECLARATION

View 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

View 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>
@ -107,6 +109,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>
@ -134,6 +137,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>
@ -172,6 +176,7 @@
# 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
@ -195,8 +200,9 @@
# 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>

View 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

View file

@ -32,17 +32,17 @@
#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"

View 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>

View file

@ -36,11 +36,14 @@
#ifndef _MY_MATH_H_
#define _MY_MATH_H__
#include <math.h>
#include <fstream>
#include <iomanip>
using namespace std;
#include <Include/compiler.h>
#include <math.h>
#include STL_FSTREAM
#include STL_IOMANIP
// FG_USING_NAMESPACE(std);
#include <fg_constants.h>
extern const double PiOver180;