Mac portability changes contributed by "Darrell Walisser" <dwaliss1@purdue.edu>
This commit is contained in:
+17
-10
@@ -95,12 +95,11 @@ skipeol( istream& in )
|
|||||||
{
|
{
|
||||||
char c = 0;
|
char c = 0;
|
||||||
// skip to end of line.
|
// skip to end of line.
|
||||||
while ( in.get(c) && (c != '\n' && c != '\r') )
|
while ( in.get(c) ) {
|
||||||
;
|
if ( (c == '\n') || (c == '\r') ) {
|
||||||
|
break;
|
||||||
#ifdef __MWERKS // -dw- need to strip line ending!
|
}
|
||||||
in >> skipws;
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
@@ -109,11 +108,15 @@ istream&
|
|||||||
skipws( istream& in ) {
|
skipws( istream& in ) {
|
||||||
char c;
|
char c;
|
||||||
while ( in.get(c) ) {
|
while ( in.get(c) ) {
|
||||||
#ifdef __MWERKS__ // -dw- for unix file compatibility
|
// -dw- for unix file compatibility
|
||||||
if ( ! (isspace( c ) ) || c != '\0' || c!='\n' || c != '\r' ) {
|
// -clo- this causes problems for unix
|
||||||
#else
|
#ifdef __MWERKS__
|
||||||
if ( ! isspace( c ) ) {
|
if ( (c == '\n') || (c == '\r') ) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ( ! isspace( c ) ) {
|
||||||
// put pack the non-space character
|
// put pack the non-space character
|
||||||
in.putback(c);
|
in.putback(c);
|
||||||
break;
|
break;
|
||||||
@@ -128,7 +131,11 @@ skipcomment( istream& in )
|
|||||||
while ( in )
|
while ( in )
|
||||||
{
|
{
|
||||||
// skip whitespace
|
// skip whitespace
|
||||||
|
#ifdef __MWERKS__
|
||||||
|
in >> ::skipws;
|
||||||
|
#else
|
||||||
in >> skipws;
|
in >> skipws;
|
||||||
|
#endif
|
||||||
|
|
||||||
char c;
|
char c;
|
||||||
if ( in.get( c ) && c != '#' )
|
if ( in.get( c ) && c != '#' )
|
||||||
|
|||||||
Reference in New Issue
Block a user