diff --git a/Lib/Bucket/newbucket.hxx b/Lib/Bucket/newbucket.hxx index c037f9dc0..c4f32e549 100644 --- a/Lib/Bucket/newbucket.hxx +++ b/Lib/Bucket/newbucket.hxx @@ -38,6 +38,13 @@ # include #endif +// I don't understand ... or should be included +// already depending on how you defined FG_HAVE_STD_INCLUDES, but I +// can go ahead and add this -- CLO +#ifdef __MWERKS__ +# include // needed fabs() +#endif + #include STL_STRING FG_USING_STD(string); diff --git a/Lib/Debug/logstream.hxx b/Lib/Debug/logstream.hxx index 5d3983f52..c49e1ebaa 100644 --- a/Lib/Debug/logstream.hxx +++ b/Lib/Debug/logstream.hxx @@ -48,6 +48,8 @@ FG_USING_STD(endl); #endif #ifdef __MWERKS__ +# define cerr std::cerr and +# define endl std::endl FG_USING_STD(iostream); #endif diff --git a/Lib/Math/fg_geodesy.cxx b/Lib/Math/fg_geodesy.cxx index 53d94ebfc..2b426502c 100644 --- a/Lib/Math/fg_geodesy.cxx +++ b/Lib/Math/fg_geodesy.cxx @@ -16,6 +16,7 @@ # include #endif +#include #include #include #include @@ -67,7 +68,7 @@ void fgGeocToGeod( double lat_geoc, double radius, double // check for domain error if ( errno == EDOM ) { - cout << "Domain ERROR in fgGeocToGeod!!!!\n"; + FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" ); *alt = 0.0; } @@ -83,7 +84,7 @@ void fgGeocToGeod( double lat_geoc, double radius, double // check for domain error if ( errno == EDOM ) { - cout << "Domain ERROR in fgGeocToGeod!!!!\n"; + FG_LOG( FG_GENERAL, FG_ALERT, "Domain ERROR in fgGeocToGeod!!!!" ); *sea_level_r = 0.0; } } diff --git a/Lib/Math/point3d.hxx b/Lib/Math/point3d.hxx index 5e419a803..d92638026 100644 --- a/Lib/Math/point3d.hxx +++ b/Lib/Math/point3d.hxx @@ -45,6 +45,13 @@ # include #endif +// I don't understand ... or should be included +// already depending on how you defined FG_HAVE_STD_INCLUDES, but I +// can go ahead and add this -- CLO +#ifdef __MWERKS__ +# include // needed fabs() +#endif + #ifndef FG_HAVE_NATIVE_SGI_COMPILERS FG_USING_STD(ostream); FG_USING_STD(istream); diff --git a/Lib/Misc/fgstream.cxx b/Lib/Misc/fgstream.cxx index 01b2c230b..3d5a09339 100644 --- a/Lib/Misc/fgstream.cxx +++ b/Lib/Misc/fgstream.cxx @@ -99,6 +99,14 @@ skipeol( istream& in ) if ( (c == '\n') || (c == '\r') ) { break; } + +#ifdef __MWERKS__ + // also break on '\0' + if ( c == '\0' ) { + break; + } +#endif + } return in; @@ -108,13 +116,14 @@ istream& skipws( istream& in ) { char c; while ( in.get(c) ) { + +#ifdef __MWERKS__ // -dw- for unix file compatibility // -clo- this causes problems for unix - #ifdef __MWERKS__ - if ( (c == '\n') || (c == '\r') ) { + if ( (c == '\n') || (c == '\r') || (c == '\0') ) { break; } - #endif +#endif if ( ! isspace( c ) ) { // put pack the non-space character diff --git a/Simulator/Airports/genapt.cxx b/Simulator/Airports/genapt.cxx index 48647631f..9dee13a8e 100644 --- a/Simulator/Airports/genapt.cxx +++ b/Simulator/Airports/genapt.cxx @@ -221,8 +221,8 @@ fgAptGenerate(const string& path, fgTILE *tile) // gpc_vertex_list perimeter_2d; fg_gzifstream in( path ); - if ( !in ) { - // exit immediately assuming an airport file for this tile + if ( !in.is_open() ) { + // return immediately assuming an airport file for this tile // doesn't exist. return 0; } diff --git a/Simulator/Astro/sky.cxx b/Simulator/Astro/sky.cxx index 1758117ad..28e5abe11 100644 --- a/Simulator/Astro/sky.cxx +++ b/Simulator/Astro/sky.cxx @@ -46,6 +46,11 @@ #include "sky.hxx" +#ifdef __MWERKS__ +# pragma global_optimizer off +#endif + + // in meters of course #define CENTER_ELEV 25000.0 diff --git a/Simulator/GUI/gui.cxx b/Simulator/GUI/gui.cxx index 303e1ac3c..7bbd73b81 100644 --- a/Simulator/GUI/gui.cxx +++ b/Simulator/GUI/gui.cxx @@ -57,6 +57,7 @@ #include
#include
#include
+#include #include