From: curt Date: Sat, 5 Jun 1999 12:45:40 +0000 (+0000) Subject: The next round of MacOS changes contributed by Darrell Walisser. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d201e9b5c5840095844cee2edad0de8ff8f1c8f1;p=simgear.git The next round of MacOS changes contributed by Darrell Walisser. Starting work on fixing tringle slivers in scenery generation tools. --- diff --git a/Lib/Bucket/newbucket.hxx b/Lib/Bucket/newbucket.hxx index c037f9dc..c4f32e54 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 5d3983f5..c49e1eba 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 53d94ebf..2b426502 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 5e419a80..d9263802 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 01b2c230..3d5a0933 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