1
0
Fork 0

Remove the remaining macintosh (not MacOS-X) and MWERKS workarounds.

This commit is contained in:
ehofman 2008-07-25 07:29:20 +00:00
parent 48c8ee3bfc
commit 6c4061bdc5
11 changed files with 1 additions and 132 deletions

View file

@ -81,13 +81,7 @@ bool FGCommList::LoadComms(const SGPath& path) {
// read in each line of the file
fin >> skipcomment;
#ifdef __MWERKS__
char c = 0;
while ( fin.get(c) && c != '\0' ) {
fin.putback(c);
#else
while ( !fin.eof() ) {
#endif
ATCData a;
fin >> a;
if(a.type == INVALID) {

View file

@ -70,20 +70,6 @@ bool FGTransmissionList::init( const SGPath& path ) {
// in >> skipeol;
// in >> skipcomment;
#ifdef __MWERKS__
char c = 0;
while ( in.get(c) && c != '\0' ) {
in.putback(c);
in >> a;
if ( a.get_type() != '[' ) {
transmissionlist_code[a.get_station()].push_back(a);
}
in >> skipcomment;
}
#else
double min = 100000;
double max = 0;
@ -107,8 +93,6 @@ bool FGTransmissionList::init( const SGPath& path ) {
*/
}
#endif
// init ATC menu
fgSetBool("/sim/atc/menu",false);

View file

@ -260,20 +260,9 @@ static string fgScanForOption( const string& option, const string& path ) {
int len = option.length();
in >> skipcomment;
#ifndef __MWERKS__
while ( ! in.eof() ) {
#else
char c = '\0';
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#endif
string line;
#if defined( macintosh )
getline( in, line, '\r' );
#else
getline( in, line, '\n' );
#endif
// catch extraneous (DOS) line ending character
if ( line[line.length() - 1] < 32 ) {

View file

@ -54,10 +54,6 @@ SG_USING_STD(endl);
#include "fg_os.hxx"
#ifdef macintosh
# include <console.h> // -dw- for command line dialog
#endif
char *homedir = ::getenv( "HOME" );
char *hostname = ::getenv( "HOSTNAME" );
bool free_hostname = false;

View file

@ -185,20 +185,9 @@ static string fgScanForOption( const string& option, const string& path ) {
int len = option.length();
in >> skipcomment;
#ifndef __MWERKS__
while ( ! in.eof() ) {
#else
char c = '\0';
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#endif
string line;
#if defined( macintosh )
getline( in, line, '\r' );
#else
getline( in, line, '\n' );
#endif
// catch extraneous (DOS) line ending character
if ( line[line.length() - 1] < 32 ) {

View file

@ -88,11 +88,6 @@ static double real_delta_time_sec = 0.0;
double delta_time_sec = 0.0;
extern float init_volume;
#ifdef macintosh
# include <console.h> // -dw- for command line dialog
#endif
// This is a record containing a bit of global housekeeping information
FGGeneral general;
@ -952,12 +947,6 @@ static void upper_case_property(const char *name)
// Main top level initialization
bool fgMainInit( int argc, char **argv ) {
#if defined( macintosh )
freopen ("stdout.txt", "w", stdout );
freopen ("stderr.txt", "w", stderr );
argc = ccommand( &argv );
#endif
// set default log levels
sglog().setLogLevels( SG_ALL, SG_ALERT );

View file

@ -83,24 +83,13 @@ enum
static double
atof( const string& str )
{
#ifdef __MWERKS__
// -dw- if ::atof is called, then we get an infinite loop
return std::atof( str.c_str() );
#else
return ::atof( str.c_str() );
#endif
}
static int
atoi( const string& str )
{
#ifdef __MWERKS__
// -dw- if ::atoi is called, then we get an infinite loop
return std::atoi( str.c_str() );
#else
return ::atoi( str.c_str() );
#endif
}
/**
@ -571,12 +560,8 @@ parse_flightplan(const string& arg)
while ( true ) {
string line;
#if defined( macintosh )
getline( in, line, '\r' );
#else
getline( in, line, '\n' );
#endif
// catch extraneous (DOS) line ending character
if ( line[line.length() - 1] < 32 )
line = line.substr( 0, line.length()-1 );
@ -1646,20 +1631,9 @@ fgParseOptions (const string& path) {
SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path );
in >> skipcomment;
#ifndef __MWERKS__
while ( ! in.eof() ) {
#else
char c = '\0';
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#endif
string line;
#if defined( macintosh )
getline( in, line, '\r' );
#else
getline( in, line, '\n' );
#endif
// catch extraneous (DOS) line ending character
int i;

View file

@ -214,14 +214,7 @@ void FGAirwayNetwork::load(SGPath path)
in >> skipeol;
// read in each remaining line of the file
#ifdef __MWERKS__
char c = 0;
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#else
while ( ! in.eof() ) {
#endif
string token;
in >> token;

View file

@ -58,14 +58,7 @@ bool FGFixList::init( SGPath path ) {
in >> skipeol;
// read in each remaining line of the file
#ifdef __MWERKS__
char c = 0;
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#else
while ( ! in.eof() ) {
#endif
FGFix fix;
in >> fix;

View file

@ -73,21 +73,7 @@ bool fgNavDBInit( FGAirportList *airports,
in >> skipeol;
in >> skipeol;
#ifdef __MWERKS__
FIXME -- Please report to the FlightGear mailing list, if you still use a
compiler identifying itself as __MWERKS__ that needs this hack.
There are 41 instances of it in the SimGear & FilghtGear code,
and they are scheduled for removal.
char c = 0;
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#else
while ( ! in.eof() ) {
#endif
FGNavRecord *r = new FGNavRecord;
in >> (*r);
if ( r->get_type() > 95 ) {
@ -169,14 +155,7 @@ bool fgNavDBInit( FGAirportList *airports,
//incarrier >> skipeol;
//incarrier >> skipeol;
#ifdef __MWERKS__
char c = 0;
while ( incarrier.get(c) && c != '\0' ) {
incarrier.putback(c);
#else
while ( ! incarrier.eof() ) {
#endif
FGNavRecord *r = new FGNavRecord;
incarrier >> (*r);
carrierlist->add ( r );
@ -208,15 +187,7 @@ bool fgNavDBInit( FGAirportList *airports,
// skip first line
inchannel >> skipeol;
#ifdef __MWERKS__
char c = 0;
while ( inchannel.get(c) && c != '\0' ) {
in.putback(c);
#else
while ( ! inchannel.eof() ) {
#endif
FGTACANRecord *r = new FGTACANRecord;
inchannel >> (*r);
channellist->add ( r );

View file

@ -30,9 +30,6 @@
#ifdef SG_HAVE_STD_INCLUDES
# include <cmath>
# include <ctime>
# ifdef macintosh
SG_USING_STD(time_t);
# endif
#else
# include <math.h>
# include <time.h>