]> git.mxchange.org Git - flightgear.git/commitdiff
Mac portability tweaks.
authorcurt <curt>
Sat, 7 Aug 1999 18:24:49 +0000 (18:24 +0000)
committercurt <curt>
Sat, 7 Aug 1999 18:24:49 +0000 (18:24 +0000)
src/Objects/materialmgr.cxx
src/Objects/obj.cxx

index ece3f4d65763de2d17ab7a1c045d67ef4cb42f74..c6e30d55886a6a1802105994c3001deec11ec009 100644 (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
index 6c000a53392bc23d4dfefe715ddcdc4eb1c500c4..eb400bb78ccd6067b287fd198b8a0b4eaf47204c 100644 (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;