1
0
Fork 0

Mac portability tweaks.

This commit is contained in:
curt 1999-08-07 18:24:49 +00:00
parent 6b2f7f4e3d
commit dec6e86f6e
2 changed files with 16 additions and 4 deletions

View file

@ -135,12 +135,18 @@ fgMATERIAL_MGR::load_lib ( void )
mpath.append( "materials" );
fg_gzifstream in( mpath.str() );
if ( ! in ) {
if ( ! in.is_open() ) {
FG_LOG( FG_GENERAL, FG_ALERT, "Cannot open file: " << mpath.str() );
exit(-1);
}
#ifndef __MWERKS__
while ( ! in.eof() ) {
#else
char c = '\0';
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#endif
// printf("%s", line);
// strip leading white space and comments

View file

@ -182,11 +182,17 @@ ssgBranch *fgObjLoad( const string& path, FGTileEntry *t) {
// ignore initial comments and blank lines. (priming the pump)
// in >> skipcomment;
string line;
// string line;
string token;
char c;
#ifdef __MWERKS__
while ( in.get(c) && c != '\0' ) {
in.putback(c);
#else
while ( ! in.eof() ) {
string token;
char c;
#endif
#if defined( MACOS )
in >> ::skipws;