#endif // __KCC
-//
-// Metrowerks
-//
-#if defined(__MWERKS__)
-/*
- CodeWarrior compiler from Metrowerks, Inc.
-*/
-# define SG_HAVE_TRAITS
-# define SG_HAVE_STD_INCLUDES
-# define SG_HAVE_STD
-# define SG_NAMESPACES
-
-# define STL_ALGORITHM <algorithm>
-# define STL_FUNCTIONAL <functional>
-# define STL_IOMANIP <iomanip>
-# define STL_IOSTREAM <iostream>
-# define STL_ITERATOR <iterator>
-# define STL_FSTREAM <fstream>
-# define STL_STDEXCEPT <stdexcept>
-# define STL_STRING <string>
-
-// Temp:
-# 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)
-
-// -dw- currently used glut has no game mode stuff
-# define GLUT_WRONG_VERSION
-
-# define SG_COMPILER_STR "Metrowerks CodeWarrior C++ version " SG_STRINGIZE(__MWERKS__)
-
-#endif // __MWERKS__
-
//
// Microsoft compilers.
//
SG_USING_STD(streambuf);
SG_USING_STD(ostream);
-#ifdef __MWERKS__
-SG_USING_STD(iostream);
-#endif
-
//
// TODO:
//
*/
#ifdef FG_NDEBUG
# define SG_LOG(C,P,M)
-#elif defined( __MWERKS__ )
-# define SG_LOG(C,P,M) ::sglog() << ::loglevel(C,P) << M << std::endl
#else
# define SG_LOG(C,P,M) sglog() << loglevel(C,P) << M << std::endl
#endif
* define directory path separators
*/
-#if defined( macintosh )
-static const char sgDirPathSep = ':';
-static const char sgDirPathSepBad = '/';
-#else
static const char sgDirPathSep = '/';
static const char sgDirPathSepBad = '\\';
-#endif
#if defined( WIN32 ) && !defined(__CYGWIN__)
static const char sgSearchPathSep = ';';
char c = '\0';
// skip to end of line.
-#ifdef __MWERKS__
- while ( in.get(c) && c != '\0' ) {
-#else
while ( in.get(c) ) {
-#endif
if ( (c == '\n') || (c == '\r') ) {
break;
}
istream&
skipws( istream& in ) {
char c;
-#ifdef __MWERKS__
- while ( in.get(c) && c != '\0' ) {
-#else
while ( in.get(c) ) {
-#endif
-#ifdef __MWERKS__
- if ( ! isspace( c ) && c != '\n' ) {
-#else
if ( ! isspace( c ) ) {
-#endif
// put pack the non-space character
in.putback(c);
break;
while ( in )
{
// skip whitespace
-#ifdef __MWERKS__
- in >> ::skipws;
-#else
in >> skipws;
-#endif
char c;
if ( in.get( c ) && c != '#' )
gzfilebuf::gzfilebuf()
: std::streambuf(),
file(NULL),
-#if defined( __MWERKS__ ) || __GNUC__ > 2
mode(ios_openmode(0)),
-#else
- mode(0),
-#endif
own_file_descriptor(false),
ibuf_size(0),
ibuffer(0)
#include <math.h>
-#if defined( macintosh )
-const float system_gamma = 1.4;
-
-#elif defined (sgi)
+#if defined (sgi)
const float system_gamma = 2.0/1.7;
#else // others
/* User specified the empty string; use UTC explicitly. */
tz = "Universal";
-#ifdef macintosh
- /* as you well know, mac paths contain leading colon, this code
- messes things up.... */
-#else
/* A leading colon means "implementation defined syntax".
We ignore the colon and always use the same algorithm:
try a data file, and if none exists parse the 1003.1 syntax. */
if (tz && *tz == ':')
++tz;
-#endif
/* Check whether the value changes since the last run. */
if (old_fgtz != NULL && tz != NULL && strcmp (tz, old_fgtz) == 0)
# include <sys/time.h> // for get/setitimer, gettimeofday, struct timeval
#endif
-// -dw- want to use metrowerks time.h
-#ifdef macintosh
-# include <time.h>
-# include <timer.h>
-#endif
-
#ifdef WIN32
# include <windows.h>
# if defined( __CYGWIN__ ) || defined( __CYGWIN32__ )
ftime(¤t);
seconds = current.time;
usec = current.millitm * 1000;
-// -dw- uses time manager
-#elif defined( macintosh )
- UnsignedWide ms;
- Microseconds(&ms);
-
- seconds = ms.lo / 1000000;
- usec = ms.lo - ( seconds * 1000000 );
#else
# error Port me
#endif