// already depending on how you defined FG_HAVE_STD_INCLUDES, but I
// can go ahead and add this -- CLO
#ifdef __MWERKS__
-# include <math.h> // needed fabs()
+FG_USING_NAMESPACE(std);
#endif
#ifndef FG_HAVE_NATIVE_SGI_COMPILERS
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;
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;
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;
}