From 708e745cfd802cfc965969ff8fa0c9e9b76d77c4 Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 11 Sep 1999 14:35:28 +0000 Subject: [PATCH] MACos fixes. --- Lib/Debug/logstream.hxx | 2 +- Lib/Math/point3d.hxx | 7 +------ Lib/Misc/fgstream.cxx | 36 +++++++++++------------------------- 3 files changed, 13 insertions(+), 32 deletions(-) diff --git a/Lib/Debug/logstream.hxx b/Lib/Debug/logstream.hxx index c49e1eba..d55ff562 100644 --- a/Lib/Debug/logstream.hxx +++ b/Lib/Debug/logstream.hxx @@ -48,7 +48,7 @@ FG_USING_STD(endl); #endif #ifdef __MWERKS__ -# define cerr std::cerr and +# define cerr std::cerr # define endl std::endl FG_USING_STD(iostream); #endif diff --git a/Lib/Math/point3d.hxx b/Lib/Math/point3d.hxx index e324410a..d830825f 100644 --- a/Lib/Math/point3d.hxx +++ b/Lib/Math/point3d.hxx @@ -49,7 +49,7 @@ // already depending on how you defined FG_HAVE_STD_INCLUDES, but I // can go ahead and add this -- CLO #ifdef __MWERKS__ -# include // needed fabs() +FG_USING_NAMESPACE(std); #endif #ifndef FG_HAVE_NATIVE_SGI_COMPILERS @@ -57,11 +57,6 @@ FG_USING_STD(ostream); FG_USING_STD(istream); #endif -// -dw- someone seems to have forgotten this... -#ifdef __MWERKS__ -FG_USING_STD(std); -#endif - const double fgPoint3_Epsilon = 0.0000001; diff --git a/Lib/Misc/fgstream.cxx b/Lib/Misc/fgstream.cxx index a7203de2..2385dcda 100644 --- a/Lib/Misc/fgstream.cxx +++ b/Lib/Misc/fgstream.cxx @@ -93,20 +93,17 @@ fg_gzifstream::attach( int fd, ios_openmode io_mode ) istream& skipeol( istream& in ) { - char c = 0; + char c = '\0'; // skip to end of line. - while ( in.get(c) ) { - if ( (c == '\n') || (c == '\r') ) { - break; - } #ifdef __MWERKS__ - // also break on '\0' - if ( c == '\0' ) { + while ( in.get(c) && c != '\0' ) { +#else + while ( in.get(c) ) { +#endif + if ( (c == '\n') || (c == '\r') ) { break; } -#endif - } return in; @@ -115,32 +112,21 @@ skipeol( istream& in ) istream& skipws( istream& in ) { char c; +#ifdef __MWERKS__ + while ( in.get(c) && c != '\0' ) { +#else while ( in.get(c) ) { +#endif #ifdef __MWERKS__ - - // -dw- for unix file compatibility - // -clo- this causes problems for unix - if ( (c == '\n') || (c == '\r') || (c == '\0') ) { - break; - } - if ( ! isspace( c ) && c != '\n' ) { - // put pack the non-space character - in.putback(c); - break; - } - #else - if ( ! isspace( c ) ) { +#endif // put pack the non-space character in.putback(c); break; } - -#endif - } return in; } -- 2.39.5