/*
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
//
#endif
#ifdef __MWERKS__
-# define cerr std::cerr and
+# define cerr std::cerr
# define endl std::endl
FG_USING_STD(iostream);
#endif
// 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
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;
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;
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;
}
// 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
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
// 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;
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.