diff --git a/Metrowerks/OpenSceneGraph.mcp b/Metrowerks/OpenSceneGraph.mcp new file mode 100644 index 000000000..63b07482a Binary files /dev/null and b/Metrowerks/OpenSceneGraph.mcp differ diff --git a/Metrowerks/PrefixWin32.h b/Metrowerks/PrefixWin32.h new file mode 100644 index 000000000..8d88f5607 --- /dev/null +++ b/Metrowerks/PrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define SG_LIBRARY 1 diff --git a/Metrowerks/osgCorePrefixWin32.h b/Metrowerks/osgCorePrefixWin32.h new file mode 100644 index 000000000..8d88f5607 --- /dev/null +++ b/Metrowerks/osgCorePrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define SG_LIBRARY 1 diff --git a/Metrowerks/osgDBPrefixWin32.h b/Metrowerks/osgDBPrefixWin32.h new file mode 100644 index 000000000..c11d21c0a --- /dev/null +++ b/Metrowerks/osgDBPrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define OSGDB_LIBRARY 1 diff --git a/Metrowerks/osgGlutPrefixWin32.h b/Metrowerks/osgGlutPrefixWin32.h new file mode 100644 index 000000000..eb5c100ba --- /dev/null +++ b/Metrowerks/osgGlutPrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define OSGGLUT_LIBRARY 1 diff --git a/Metrowerks/osgTextPrefixWin32.h b/Metrowerks/osgTextPrefixWin32.h new file mode 100644 index 000000000..a18d0e9f2 --- /dev/null +++ b/Metrowerks/osgTextPrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define OSGTEXT_LIBRARY 1 diff --git a/Metrowerks/osgUtilPrefixWin32.h b/Metrowerks/osgUtilPrefixWin32.h new file mode 100644 index 000000000..5e3e9000b --- /dev/null +++ b/Metrowerks/osgUtilPrefixWin32.h @@ -0,0 +1,2 @@ +#define WIN32 1 +#define OSGUTIL_LIBRARY 1 diff --git a/include/osg/BoundsChecking b/include/osg/BoundsChecking index 840f41f37..d1f48cb06 100644 --- a/include/osg/BoundsChecking +++ b/include/osg/BoundsChecking @@ -194,6 +194,6 @@ inline void clampArray4BetweenRange(A& value,const T minValue,const T maxValue,c clampArrayElementsBetweenRange(value,0u,3u,minValue,maxValue,valueName); } -}; +} #endif diff --git a/include/osg/Export b/include/osg/Export index 80c306e1d..5de474684 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -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 diff --git a/include/osg/GL b/include/osg/GL index fce999a27..1be8198a4 100644 --- a/include/osg/GL +++ b/include/osg/GL @@ -12,8 +12,8 @@ #ifdef __DARWIN_OSX__ #include #else - #include - #endif + #include + #endif #endif // required for compatibility with glext.h sytle function definitions of @@ -40,7 +40,7 @@ // to avoid name space pollution, but Win32's // needs APIENTRY and WINGDIAPI defined properly. // F - # if 0 + # if defined(__MWERKS__) # define WIN32_LEAN_AND_MEAN # include # else diff --git a/include/osg/Math b/include/osg/Math index 56b74cde2..ba32e6d3a 100644 --- a/include/osg/Math +++ b/include/osg/Math @@ -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 diff --git a/include/osg/Statistics b/include/osg/Statistics index fe0b20276..5b9bc2ed0 100644 --- a/include/osg/Statistics +++ b/include/osg/Statistics @@ -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: diff --git a/include/osgDB/Export b/include/osgDB/Export index 56133eff3..e06c9bd43 100644 --- a/include/osgDB/Export +++ b/include/osgDB/Export @@ -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 diff --git a/include/osgDB/FieldReaderIterator b/include/osgDB/FieldReaderIterator index ca5bdca41..148285fcc 100644 --- a/include/osgDB/FieldReaderIterator +++ b/include/osgDB/FieldReaderIterator @@ -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(); diff --git a/include/osgGLUT/Export b/include/osgGLUT/Export index b49a9d489..a75739fdb 100644 --- a/include/osgGLUT/Export +++ b/include/osgGLUT/Export @@ -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 diff --git a/include/osgUtil/Export b/include/osgUtil/Export index 950459d06..985fc5d9e 100644 --- a/include/osgUtil/Export +++ b/include/osgUtil/Export @@ -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 diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index a59ada7e7..46e69de32 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -1,3 +1,7 @@ +#include +#include +#include + #include #include #include @@ -11,8 +15,6 @@ #include #include -#include -#include #include @@ -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; } diff --git a/src/osg/DisplaySettings.cpp b/src/osg/DisplaySettings.cpp index 98f977cae..37546907e 100644 --- a/src/osg/DisplaySettings.cpp +++ b/src/osg/DisplaySettings.cpp @@ -4,6 +4,8 @@ using namespace osg; +using namespace std; + DisplaySettings::DisplaySettings(const DisplaySettings& vs):Referenced() { copy(vs); diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index a1f089d7d..a126591fc 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -11,6 +11,7 @@ using namespace osg; +using namespace std; Image::Image() { diff --git a/src/osg/Notify.cpp b/src/osg/Notify.cpp index 75f2bcfa0..ee8bcb2d9 100644 --- a/src/osg/Notify.cpp +++ b/src/osg/Notify.cpp @@ -1,9 +1,7 @@ #include #include -#if defined(__BCPLUSPLUS__) -using std::toupper; -#endif +using namespace std; osg::NotifySeverity osg::g_NotifyLevel = osg::NOTICE; std::ofstream *osg::g_NotifyNulStream; diff --git a/src/osgDB/Field.cpp b/src/osgDB/Field.cpp index 3a2fd8975..b4394e7ce 100644 --- a/src/osgDB/Field.cpp +++ b/src/osgDB/Field.cpp @@ -1,6 +1,7 @@ #include using namespace osgDB; +using namespace std; Field::Field() { diff --git a/src/osgDB/FileNameUtils.cpp b/src/osgDB/FileNameUtils.cpp index abe7b84bf..79f8b3a59 100644 --- a/src/osgDB/FileNameUtils.cpp +++ b/src/osgDB/FileNameUtils.cpp @@ -2,12 +2,14 @@ #if defined(__sgi) #include -#elif !defined(WIN32) +#elif !defined(WIN32) || defined(__MWERKS__) #include 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. diff --git a/src/osgGLUT/Viewer.cpp b/src/osgGLUT/Viewer.cpp index a761b3331..c7341c914 100644 --- a/src/osgGLUT/Viewer.cpp +++ b/src/osgGLUT/Viewer.cpp @@ -2,6 +2,9 @@ #pragma warning( disable : 4786 ) #endif +#include +#include + #include #if (!defined(WIN32) && !defined(macintosh)) || defined(__CYGWIN__) #include @@ -49,12 +52,12 @@ #define USE_GLUT #endif -#include - +/* #if defined(WIN32) && !defined(__CYGWIN__) #include #else #endif +*/ #include 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; } } diff --git a/src/osgUtil/NvTriStripObjects.cpp b/src/osgUtil/NvTriStripObjects.cpp index 44509b151..92c3c40da 100644 --- a/src/osgUtil/NvTriStripObjects.cpp +++ b/src/osgUtil/NvTriStripObjects.cpp @@ -9,6 +9,8 @@ #include +#include + VertexCache::VertexCache() { VertexCache(16);