Remove the remaining macintosh (not MacOS-X) and MWERKS workarounds.
This commit is contained in:
parent
48c8ee3bfc
commit
6c4061bdc5
11 changed files with 1 additions and 132 deletions
|
@ -81,13 +81,7 @@ bool FGCommList::LoadComms(const SGPath& path) {
|
||||||
// read in each line of the file
|
// read in each line of the file
|
||||||
fin >> skipcomment;
|
fin >> skipcomment;
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
|
||||||
char c = 0;
|
|
||||||
while ( fin.get(c) && c != '\0' ) {
|
|
||||||
fin.putback(c);
|
|
||||||
#else
|
|
||||||
while ( !fin.eof() ) {
|
while ( !fin.eof() ) {
|
||||||
#endif
|
|
||||||
ATCData a;
|
ATCData a;
|
||||||
fin >> a;
|
fin >> a;
|
||||||
if(a.type == INVALID) {
|
if(a.type == INVALID) {
|
||||||
|
|
|
@ -70,20 +70,6 @@ bool FGTransmissionList::init( const SGPath& path ) {
|
||||||
// in >> skipeol;
|
// in >> skipeol;
|
||||||
// in >> skipcomment;
|
// 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 min = 100000;
|
||||||
double max = 0;
|
double max = 0;
|
||||||
|
|
||||||
|
@ -107,8 +93,6 @@ bool FGTransmissionList::init( const SGPath& path ) {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// init ATC menu
|
// init ATC menu
|
||||||
fgSetBool("/sim/atc/menu",false);
|
fgSetBool("/sim/atc/menu",false);
|
||||||
|
|
||||||
|
|
|
@ -260,20 +260,9 @@ static string fgScanForOption( const string& option, const string& path ) {
|
||||||
int len = option.length();
|
int len = option.length();
|
||||||
|
|
||||||
in >> skipcomment;
|
in >> skipcomment;
|
||||||
#ifndef __MWERKS__
|
|
||||||
while ( ! in.eof() ) {
|
while ( ! in.eof() ) {
|
||||||
#else
|
|
||||||
char c = '\0';
|
|
||||||
while ( in.get(c) && c != '\0' ) {
|
|
||||||
in.putback(c);
|
|
||||||
#endif
|
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
#if defined( macintosh )
|
|
||||||
getline( in, line, '\r' );
|
|
||||||
#else
|
|
||||||
getline( in, line, '\n' );
|
getline( in, line, '\n' );
|
||||||
#endif
|
|
||||||
|
|
||||||
// catch extraneous (DOS) line ending character
|
// catch extraneous (DOS) line ending character
|
||||||
if ( line[line.length() - 1] < 32 ) {
|
if ( line[line.length() - 1] < 32 ) {
|
||||||
|
|
|
@ -54,10 +54,6 @@ SG_USING_STD(endl);
|
||||||
|
|
||||||
#include "fg_os.hxx"
|
#include "fg_os.hxx"
|
||||||
|
|
||||||
#ifdef macintosh
|
|
||||||
# include <console.h> // -dw- for command line dialog
|
|
||||||
#endif
|
|
||||||
|
|
||||||
char *homedir = ::getenv( "HOME" );
|
char *homedir = ::getenv( "HOME" );
|
||||||
char *hostname = ::getenv( "HOSTNAME" );
|
char *hostname = ::getenv( "HOSTNAME" );
|
||||||
bool free_hostname = false;
|
bool free_hostname = false;
|
||||||
|
|
|
@ -185,20 +185,9 @@ static string fgScanForOption( const string& option, const string& path ) {
|
||||||
int len = option.length();
|
int len = option.length();
|
||||||
|
|
||||||
in >> skipcomment;
|
in >> skipcomment;
|
||||||
#ifndef __MWERKS__
|
|
||||||
while ( ! in.eof() ) {
|
while ( ! in.eof() ) {
|
||||||
#else
|
|
||||||
char c = '\0';
|
|
||||||
while ( in.get(c) && c != '\0' ) {
|
|
||||||
in.putback(c);
|
|
||||||
#endif
|
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
#if defined( macintosh )
|
|
||||||
getline( in, line, '\r' );
|
|
||||||
#else
|
|
||||||
getline( in, line, '\n' );
|
getline( in, line, '\n' );
|
||||||
#endif
|
|
||||||
|
|
||||||
// catch extraneous (DOS) line ending character
|
// catch extraneous (DOS) line ending character
|
||||||
if ( line[line.length() - 1] < 32 ) {
|
if ( line[line.length() - 1] < 32 ) {
|
||||||
|
|
|
@ -88,11 +88,6 @@ static double real_delta_time_sec = 0.0;
|
||||||
double delta_time_sec = 0.0;
|
double delta_time_sec = 0.0;
|
||||||
extern float init_volume;
|
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
|
// This is a record containing a bit of global housekeeping information
|
||||||
FGGeneral general;
|
FGGeneral general;
|
||||||
|
|
||||||
|
@ -952,12 +947,6 @@ static void upper_case_property(const char *name)
|
||||||
// Main top level initialization
|
// Main top level initialization
|
||||||
bool fgMainInit( int argc, char **argv ) {
|
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
|
// set default log levels
|
||||||
sglog().setLogLevels( SG_ALL, SG_ALERT );
|
sglog().setLogLevels( SG_ALL, SG_ALERT );
|
||||||
|
|
||||||
|
|
|
@ -83,24 +83,13 @@ enum
|
||||||
static double
|
static double
|
||||||
atof( const string& str )
|
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() );
|
return ::atof( str.c_str() );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
atoi( const string& str )
|
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() );
|
return ::atoi( str.c_str() );
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -571,12 +560,8 @@ parse_flightplan(const string& arg)
|
||||||
|
|
||||||
while ( true ) {
|
while ( true ) {
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
#if defined( macintosh )
|
|
||||||
getline( in, line, '\r' );
|
|
||||||
#else
|
|
||||||
getline( in, line, '\n' );
|
getline( in, line, '\n' );
|
||||||
#endif
|
|
||||||
// catch extraneous (DOS) line ending character
|
// catch extraneous (DOS) line ending character
|
||||||
if ( line[line.length() - 1] < 32 )
|
if ( line[line.length() - 1] < 32 )
|
||||||
line = line.substr( 0, line.length()-1 );
|
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 );
|
SG_LOG( SG_GENERAL, SG_INFO, "Processing config file: " << path );
|
||||||
|
|
||||||
in >> skipcomment;
|
in >> skipcomment;
|
||||||
#ifndef __MWERKS__
|
|
||||||
while ( ! in.eof() ) {
|
while ( ! in.eof() ) {
|
||||||
#else
|
|
||||||
char c = '\0';
|
|
||||||
while ( in.get(c) && c != '\0' ) {
|
|
||||||
in.putback(c);
|
|
||||||
#endif
|
|
||||||
string line;
|
string line;
|
||||||
|
|
||||||
#if defined( macintosh )
|
|
||||||
getline( in, line, '\r' );
|
|
||||||
#else
|
|
||||||
getline( in, line, '\n' );
|
getline( in, line, '\n' );
|
||||||
#endif
|
|
||||||
|
|
||||||
// catch extraneous (DOS) line ending character
|
// catch extraneous (DOS) line ending character
|
||||||
int i;
|
int i;
|
||||||
|
|
|
@ -214,14 +214,7 @@ void FGAirwayNetwork::load(SGPath path)
|
||||||
in >> skipeol;
|
in >> skipeol;
|
||||||
|
|
||||||
// read in each remaining line of the file
|
// 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() ) {
|
while ( ! in.eof() ) {
|
||||||
#endif
|
|
||||||
string token;
|
string token;
|
||||||
in >> token;
|
in >> token;
|
||||||
|
|
||||||
|
|
|
@ -58,14 +58,7 @@ bool FGFixList::init( SGPath path ) {
|
||||||
in >> skipeol;
|
in >> skipeol;
|
||||||
|
|
||||||
// read in each remaining line of the file
|
// 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() ) {
|
while ( ! in.eof() ) {
|
||||||
#endif
|
|
||||||
|
|
||||||
FGFix fix;
|
FGFix fix;
|
||||||
in >> fix;
|
in >> fix;
|
||||||
|
|
|
@ -73,21 +73,7 @@ bool fgNavDBInit( FGAirportList *airports,
|
||||||
in >> skipeol;
|
in >> skipeol;
|
||||||
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() ) {
|
while ( ! in.eof() ) {
|
||||||
#endif
|
|
||||||
|
|
||||||
FGNavRecord *r = new FGNavRecord;
|
FGNavRecord *r = new FGNavRecord;
|
||||||
in >> (*r);
|
in >> (*r);
|
||||||
if ( r->get_type() > 95 ) {
|
if ( r->get_type() > 95 ) {
|
||||||
|
@ -169,14 +155,7 @@ bool fgNavDBInit( FGAirportList *airports,
|
||||||
//incarrier >> skipeol;
|
//incarrier >> skipeol;
|
||||||
//incarrier >> skipeol;
|
//incarrier >> skipeol;
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
|
||||||
char c = 0;
|
|
||||||
while ( incarrier.get(c) && c != '\0' ) {
|
|
||||||
incarrier.putback(c);
|
|
||||||
#else
|
|
||||||
while ( ! incarrier.eof() ) {
|
while ( ! incarrier.eof() ) {
|
||||||
#endif
|
|
||||||
|
|
||||||
FGNavRecord *r = new FGNavRecord;
|
FGNavRecord *r = new FGNavRecord;
|
||||||
incarrier >> (*r);
|
incarrier >> (*r);
|
||||||
carrierlist->add ( r );
|
carrierlist->add ( r );
|
||||||
|
@ -208,15 +187,7 @@ bool fgNavDBInit( FGAirportList *airports,
|
||||||
|
|
||||||
// skip first line
|
// skip first line
|
||||||
inchannel >> skipeol;
|
inchannel >> skipeol;
|
||||||
|
|
||||||
#ifdef __MWERKS__
|
|
||||||
char c = 0;
|
|
||||||
while ( inchannel.get(c) && c != '\0' ) {
|
|
||||||
in.putback(c);
|
|
||||||
#else
|
|
||||||
while ( ! inchannel.eof() ) {
|
while ( ! inchannel.eof() ) {
|
||||||
#endif
|
|
||||||
|
|
||||||
FGTACANRecord *r = new FGTACANRecord;
|
FGTACANRecord *r = new FGTACANRecord;
|
||||||
inchannel >> (*r);
|
inchannel >> (*r);
|
||||||
channellist->add ( r );
|
channellist->add ( r );
|
||||||
|
|
|
@ -30,9 +30,6 @@
|
||||||
#ifdef SG_HAVE_STD_INCLUDES
|
#ifdef SG_HAVE_STD_INCLUDES
|
||||||
# include <cmath>
|
# include <cmath>
|
||||||
# include <ctime>
|
# include <ctime>
|
||||||
# ifdef macintosh
|
|
||||||
SG_USING_STD(time_t);
|
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
# include <math.h>
|
# include <math.h>
|
||||||
# include <time.h>
|
# include <time.h>
|
||||||
|
|
Loading…
Add table
Reference in a new issue