]> git.mxchange.org Git - flightgear.git/commitdiff
MACos fixes.
authorcurt <curt>
Sat, 11 Sep 1999 14:35:28 +0000 (14:35 +0000)
committercurt <curt>
Sat, 11 Sep 1999 14:35:28 +0000 (14:35 +0000)
Include/compiler.h
Lib/Debug/logstream.hxx
Lib/Math/point3d.hxx
Lib/Misc/fgstream.cxx
Simulator/Main/options.cxx
Simulator/Objects/materialmgr.cxx
Simulator/Objects/obj.cxx
Thanks

index 2b4b940d3b0f52edf7f5560a3087e946f3288033..95fd8afcb00447e32f312e611f522c3bdefbd06b 100644 (file)
 /*
   CodeWarrior compiler from Metrowerks, Inc.
 */
-#  if (__MWERKS__ < 0x0900) //|| macintosh
-#    define FG_HAVE_TRAITS
-#    define FG_HAVE_STD_INCLUDES
-#    define FG_HAVE_STD
-#    define FG_NAMESPACES
+#  define FG_HAVE_TRAITS
+#  define FG_HAVE_STD_INCLUDES
+#  define FG_HAVE_STD
+#  define FG_NAMESPACES
 
-#    define STL_ALGORITHM  <algorithm>
-#    define STL_FUNCTIONAL <functional>
-#    define STL_IOMANIP    <iomanip>
-#    define STL_IOSTREAM   <iostream>
-#    define STL_STDEXCEPT  <stdexcept>
-#    define STL_STRING     <string>
+#  define STL_ALGORITHM  <algorithm>
+#  define STL_FUNCTIONAL <functional>
+#  define STL_IOMANIP    <iomanip>
+#  define STL_IOSTREAM   <iostream>
+#  define STL_STDEXCEPT  <stdexcept>
+#  define STL_STRING     <string>
 
 // Temp:
-#    define bcopy(from, to, n) memcpy(to, from, n)
+#  define bcopy(from, to, n) memcpy(to, from, n)
 
 // -rp- please use FG_MEM_COPY everywhere !
-#    define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
+#  define FG_MEM_COPY(to,from,n) memcpy(to, from, n)
 
 // -dw- currently used glut has no game mode stuff
-#    define GLUT_WRONG_VERSION
-
-#  elif (__MWERKS__ >= 0x0900) && __INTEL__
-#    error still to be supported...
-#  else
-#    error unknown Metrowerks compiler
-#  endif
+#  define GLUT_WRONG_VERSION
 #endif
 
 //
index c49e1ebaaf99c0e013fcc1a8014c945ad5acc0d4..d55ff562996016055b470b28e63698df6eddfaec 100644 (file)
@@ -48,7 +48,7 @@ FG_USING_STD(endl);
 #endif
 
 #ifdef __MWERKS__
-#  define cerr std::cerr and
+#  define cerr std::cerr
 #  define endl std::endl
 FG_USING_STD(iostream);
 #endif
index e324410a153823080e5e127708ee36994bd43d93..d830825ff37842fa0756c0457011d707c9d7fe02 100644 (file)
@@ -49,7 +49,7 @@
 // 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
@@ -57,11 +57,6 @@ FG_USING_STD(ostream);
 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;
 
index a7203de2cbbe626ae1f70e6694c6a483db93d8bc..2385dcdad4dcf50afd96328cd210294939d58c5d 100644 (file)
@@ -93,20 +93,17 @@ fg_gzifstream::attach( int fd, ios_openmode io_mode )
 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;
@@ -115,32 +112,21 @@ skipeol( istream& 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;
 }
index da93926dbcac000062d3ab130d28a36b2a78b28e..3701b495e4d14d7f71ee92432e1524d124c2a7ae 100644 (file)
@@ -694,13 +694,19 @@ int fgOPTIONS::parse_command_line( int argc, char **argv ) {
 // Parse config file options
 int fgOPTIONS::parse_config_file( const string& path ) {
     fg_gzifstream in( path );
-    if ( !in )
+    if ( !in.is_open() )
        return(FG_OPTIONS_ERROR);
 
     FG_LOG( FG_GENERAL, FG_INFO, "Processing config file: " << path );
 
     in >> skipcomment;
-    while ( !in.eof() ) {
+#ifndef __MWERKS__
+    while ( ! in.eof() ) {
+#else
+    char c = '\0';
+    while ( in.get(c) && c != '\0' ) {
+       in.putback(c);
+#endif
        string line;
 
 #ifdef GETLINE_NEEDS_TERMINATOR
index 182235a6bc02c5d7d8ec53ffc95ae66b664d9063..28e21c8034495d276bbc0d8cb603e6a0a7de116f 100644 (file)
@@ -134,12 +134,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 b890d7decced8ba7bb2c602d338471a6fa5d1c85..6172ac69281d5f71fbb0c5f415c28420616d04ec 100644 (file)
@@ -168,13 +168,19 @@ int 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 )
+#ifdef __MWERKS__
        in >> ::skipws;
 #else
        in >> skipws;
diff --git a/Thanks b/Thanks
index fd2ea138a0fc4087ea6836913a256c6c653a87db..29ff235f09825f70d5ecd28e0addd8cf9002bdce 100644 (file)
--- a/Thanks
+++ b/Thanks
@@ -136,7 +136,7 @@ Bob Kuehne <rpk@sgi.com>
   Redid the Makefile system so it is simpler and more robust.
 
 
-Vasily Lewis <vlewis@woodsoup.org>  http://www.woodsoup.org
+WoodSoup Project  http://www.woodsoup.org
   Provided computing resources and services so that the Flight Gear 
   project could have real home.  This includes, web services, ftp services
   shell accounts, email lists, dns services, etc.