Mac portability tweaks.
This commit is contained in:
parent
6b2f7f4e3d
commit
dec6e86f6e
2 changed files with 16 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue