Add support for Metrowerks Codewarrior build under Windows.

This commit is contained in:
Robert Osfield
2002-02-22 17:12:10 +00:00
parent ddc1212cb4
commit 00e91eec1d
24 changed files with 50 additions and 21 deletions

Binary file not shown.

2
Metrowerks/PrefixWin32.h Normal file
View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define SG_LIBRARY 1

View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define SG_LIBRARY 1

View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define OSGDB_LIBRARY 1

View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define OSGGLUT_LIBRARY 1

View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define OSGTEXT_LIBRARY 1

View File

@@ -0,0 +1,2 @@
#define WIN32 1
#define OSGUTIL_LIBRARY 1

View File

@@ -194,6 +194,6 @@ inline void clampArray4BetweenRange(A& value,const T minValue,const T maxValue,c
clampArrayElementsBetweenRange(value,0u,3u,minValue,maxValue,valueName);
}
};
}
#endif

View File

@@ -13,7 +13,7 @@
#pragma warning( disable : 4290 )
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# ifdef SG_LIBRARY
# define SG_EXPORT __declspec(dllexport)
# else

View File

@@ -12,8 +12,8 @@
#ifdef __DARWIN_OSX__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif
#include <GL/gl.h>
#endif
#endif
// required for compatibility with glext.h sytle function definitions of
@@ -40,7 +40,7 @@
// to avoid name space pollution, but Win32's <GL/gl.h>
// needs APIENTRY and WINGDIAPI defined properly.
// F
# if 0
# if defined(__MWERKS__)
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# else

View File

@@ -72,7 +72,7 @@ inline double inRadians(double angle) { return angle; }
inline double DegreesToRadians(double angle) { return angle*PI/180.0; }
inline double RadiansToDegrees(double angle) { return angle*180.0/PI; }
#if defined(WIN32) && !defined(__CYGWIN__)
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__MWERKS__)
inline bool isNaN(float v) { return _isnan(v)!=0; }
inline bool isNaN(double v) { return _isnan(v)!=0; }
#else

View File

@@ -23,7 +23,7 @@ namespace osg {
* each trifan or tristrip = (length-2) triangles and so on.
*/
class SG_EXPORT Statistics : public osg::Referenced, public osg::Drawable::AttributeFunctor
class Statistics : public osg::Referenced, public osg::Drawable::AttributeFunctor
{
public:

View File

@@ -13,7 +13,7 @@
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# ifdef OSGDB_LIBRARY
# define OSGDB_EXPORT __declspec(dllexport)
# else

View File

@@ -23,7 +23,7 @@ class OSGDB_EXPORT FieldReaderIterator
FieldReaderIterator(const FieldReaderIterator& ic);
virtual ~FieldReaderIterator();
virtual FieldReaderIterator& operator = (const FieldReaderIterator& ic);
FieldReaderIterator& operator = (const FieldReaderIterator& ic);
void attach(std::istream* input);
void detach();

View File

@@ -13,7 +13,7 @@
#pragma warning( disable : 4786 )
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# ifdef OSGGLUT_LIBRARY
# define OSGGLUT_EXPORT __declspec(dllexport)
# else

View File

@@ -13,7 +13,7 @@
#pragma warning( disable : 4786 )
#endif
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__)
#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined( __BCPLUSPLUS__) || defined( __MWERKS__)
# ifdef OSGUTIL_LIBRARY
# define OSGUTIL_EXPORT __declspec(dllexport)
# else

View File

@@ -1,3 +1,7 @@
#include <osg/GL>
#include <osgGLUT/glut>
#include <osgGLUT/Viewer>
#include <osg/Transform>
#include <osg/Billboard>
#include <osg/Geode>
@@ -11,8 +15,6 @@
#include <osgUtil/FlightManipulator>
#include <osgUtil/DriveManipulator>
#include <osgGLUT/glut>
#include <osgGLUT/Viewer>
#include <osgUtil/Optimizer>
@@ -56,7 +58,7 @@ int main( int argc, char **argv )
if (argc<2)
{
write_usage(osg::notify(osg::NOTICE),argv[0]);
write_usage(std::cout,argv[0]);
return 0;
}

View File

@@ -4,6 +4,8 @@
using namespace osg;
using namespace std;
DisplaySettings::DisplaySettings(const DisplaySettings& vs):Referenced()
{
copy(vs);

View File

@@ -11,6 +11,7 @@
using namespace osg;
using namespace std;
Image::Image()
{

View File

@@ -1,9 +1,7 @@
#include <osg/Notify>
#include <string>
#if defined(__BCPLUSPLUS__)
using std::toupper;
#endif
using namespace std;
osg::NotifySeverity osg::g_NotifyLevel = osg::NOTICE;
std::ofstream *osg::g_NotifyNulStream;

View File

@@ -1,6 +1,7 @@
#include <osgDB/Field>
using namespace osgDB;
using namespace std;
Field::Field()
{

View File

@@ -2,12 +2,14 @@
#if defined(__sgi)
#include <ctype.h>
#elif !defined(WIN32)
#elif !defined(WIN32) || defined(__MWERKS__)
#include <cctype>
using std::tolower;
using std::strlen;
#endif
using namespace std;
//
// // mac requires std::tolower, but IRIX MipsPro doesn't like it,
// // so use this preprocessor to allow mac and mipspro to work.

View File

@@ -2,6 +2,9 @@
#pragma warning( disable : 4786 )
#endif
#include <osg/GL>
#include <osgGLUT/glut>
#include <stdlib.h>
#if (!defined(WIN32) && !defined(macintosh)) || defined(__CYGWIN__)
#include <unistd.h>
@@ -49,12 +52,12 @@
#define USE_GLUT
#endif
#include <osgGLUT/glut>
/*
#if defined(WIN32) && !defined(__CYGWIN__)
#include <sys/timeb.h>
#else
#endif
*/
#include <osg/Timer>
osg::Timer g_timer;
@@ -72,6 +75,7 @@ using namespace osg;
using namespace osgUtil;
using namespace osgGLUT;
using namespace std;
Viewer* Viewer::s_theViewer = 0;
@@ -1081,8 +1085,13 @@ void Viewer::keyboard(unsigned char key, int x, int y)
}
break;
case 27 : // Escape
case 27 :
// Escape
#ifdef __MWERKS__
std::exit(0); // avoid collision of std::exit(..) / exit(..) compile errors.
#else
exit(0);
#endif
break;
}
}

View File

@@ -9,6 +9,8 @@
#include <osg/Notify>
#include <string.h>
VertexCache::VertexCache()
{
VertexCache(16);