diff --git a/INSTALL b/INSTALL index cb21e5c30..549e33077 100644 --- a/INSTALL +++ b/INSTALL @@ -115,6 +115,10 @@ Compiling under IRIX has been tested under MIPSPro7.3 & MIPSPro7.2.1, and *may* compile under previous versions but has yet to be tested. It is recommended to use MIPSPro7.3.1.1m. + + When compiling with MIPSPro7.2.1 you will need to use STLport for its + proper implementation of Standard C++ iostreams which are missing + from compiler own implementation. To compile, from the OSG root directory, type : diff --git a/Make/makedefs.irix.nonstd b/Make/makedefs.irix.nonstd index 0308dcb7f..79aaad466 100644 --- a/Make/makedefs.irix.nonstd +++ b/Make/makedefs.irix.nonstd @@ -8,8 +8,8 @@ DEPFILES = $(OBJS:.o=.d) C++ = CC YFLAGS = -d -#CFLAGS = -O2 -n32 -MDupdate $(MAKEDEPEND) -DOSG_USE_IO_DOT_H -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303 -CFLAGS = -O2 -n32 -DOSG_USE_IO_DOT_H -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303 +#CFLAGS = -O2 -n32 -MDupdate $(MAKEDEPEND) -OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303 +CFLAGS = -O2 -n32 --OPT:Olimit=0 -DEBUG:woff=1682 -DEBUG:woff=3303 C++FLAGS = ${CFLAGS} CPPFLAGS = ${CFLAGS} diff --git a/include/osg/Matrix b/include/osg/Matrix index e34c2d110..0e63cbc8d 100644 --- a/include/osg/Matrix +++ b/include/osg/Matrix @@ -9,13 +9,7 @@ #include #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::ostream; -using std::endl; -#endif namespace osg { @@ -277,14 +271,14 @@ inline Vec4 Matrix::operator* (const Vec4& v) const return postMult(v); } -inline ostream& operator<< (ostream& os, const Matrix& m ) +inline std::ostream& operator<< (std::ostream& os, const Matrix& m ) { - os << "{"< -#ifdef OSG_USE_IO_DOT_H -#include -#include -#else #include #include -using std::ostream; -using std::ofstream; -using std::endl; -using std::cout; -using std::cerr; -#endif - namespace osg { @@ -43,7 +32,7 @@ enum NotifySeverity { SG_EXPORT extern NotifySeverity g_NotifyLevel; /** global notify nul stream. added for Mac OSX */ -SG_EXPORT extern ofstream *g_NotifyNulStream; +SG_EXPORT extern std::ofstream *g_NotifyNulStream; /** global notify nul stream. added for Mac OSX */ SG_EXPORT extern bool g_NotifyInit; @@ -79,19 +68,20 @@ SG_EXPORT extern bool initNotifyLevel(); // previous implementation was causing Mac OSX to misbehave. This version // places less stress on compiler and runs on Mac -inline ostream& notify(const NotifySeverity severity) +inline std::ostream& notify(const NotifySeverity severity) { if (!g_NotifyInit) initNotifyLevel(); if (severity<=g_NotifyLevel) { - if (severity<=osg::WARN) return cerr; - else return cout; + if (severity<=osg::WARN) return std::cerr; + else return std::cout; } return *osg::g_NotifyNulStream; } -inline ostream& notify(void) { return notify(osg::INFO); } +inline std::ostream& notify(void) { return notify(osg::INFO); } + }; #endif diff --git a/include/osg/Vec2 b/include/osg/Vec2 index ea6a41b44..269a64446 100644 --- a/include/osg/Vec2 +++ b/include/osg/Vec2 @@ -7,12 +7,7 @@ #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::ostream; -#endif namespace osg { @@ -152,7 +147,7 @@ class Vec2 return( norm ); } - friend inline ostream& operator << (ostream& output, const Vec2& vec) + friend inline std::ostream& operator << (std::ostream& output, const Vec2& vec) { output << vec._v[0] << " " << vec._v[1]; diff --git a/include/osg/Vec3 b/include/osg/Vec3 index 6758b26a7..53287b347 100644 --- a/include/osg/Vec3 +++ b/include/osg/Vec3 @@ -7,12 +7,7 @@ #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::ostream; -#endif namespace osg { @@ -178,7 +173,7 @@ class Vec3 }; // end of class Vec3 -inline ostream& operator << (ostream& output, const Vec3& vec) +inline std::ostream& operator << (std::ostream& output, const Vec3& vec) { output << vec._v[0] << " " << vec._v[1] << " " diff --git a/include/osg/Vec4 b/include/osg/Vec4 index 740b9a43a..eb7d92554 100644 --- a/include/osg/Vec4 +++ b/include/osg/Vec4 @@ -7,12 +7,7 @@ #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::ostream; -#endif namespace osg { @@ -182,7 +177,7 @@ class Vec4 return( norm ); } - friend inline ostream& operator << (ostream& output, const Vec4& vec) + friend inline std::ostream& operator << (std::ostream& output, const Vec4& vec) { output << vec._v[0] << " " << vec._v[1] << " " diff --git a/include/osgDB/FieldReader b/include/osgDB/FieldReader index a1ac06dec..d1dc03265 100644 --- a/include/osgDB/FieldReader +++ b/include/osgDB/FieldReader @@ -10,13 +10,7 @@ #include #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::istream; -using std::ifstream; -#endif namespace osgDB { @@ -32,7 +26,7 @@ class OSGDB_EXPORT FieldReader virtual FieldReader& operator = (const FieldReader& ic); - void attach(istream* input); + void attach(std::istream* input); void detach(); virtual bool eof() const; @@ -51,7 +45,7 @@ class OSGDB_EXPORT FieldReader void _free(); void _copy(const FieldReader& ic); - istream* _fin; + std::istream* _fin; bool _eof; bool findStartOfNextField(); diff --git a/include/osgDB/Output b/include/osgDB/Output index dd3c3ae1a..1afa709ff 100644 --- a/include/osgDB/Output +++ b/include/osgDB/Output @@ -12,18 +12,13 @@ #include #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using std::ofstream; -#endif namespace osgDB { /** ofstream wrapper class for adding support for indenting. Used in output of .osg ASCII files to improve their readability.*/ -class OSGDB_EXPORT Output : public ofstream +class OSGDB_EXPORT Output : public std::ofstream { public: diff --git a/include/osgGLUT/Viewer b/include/osgGLUT/Viewer index 5f692e527..9a9508ccf 100644 --- a/include/osgGLUT/Viewer +++ b/include/osgGLUT/Viewer @@ -22,14 +22,6 @@ #include -/* -#ifdef OSG_USE_IO_DOT_H -#include -#else -#include -using namespace std; -#endif -*/ namespace osgGLUT{ /** A basic viewer base class which provides a window, simple keyboard and mouse interaction. diff --git a/src/Demos/sgv/sgv.cpp b/src/Demos/sgv/sgv.cpp index 111a558ab..e2f115ac6 100644 --- a/src/Demos/sgv/sgv.cpp +++ b/src/Demos/sgv/sgv.cpp @@ -149,8 +149,8 @@ int main( int argc, char **argv ) osgGLUT::Viewer viewer; viewer.addViewport( rootnode ); - //osgUtil::SceneView* sceneview = viewer.getViewportSceneView(0); - //sceneview->setStereoMode(osgUtil::SceneView::ANAGLYPHIC_STEREO); +// osgUtil::SceneView* sceneview = viewer.getViewportSceneView(0); +// sceneview->setStereoMode(osgUtil::SceneView::ANAGLYPHIC_STEREO); // register trackball, flight and drive. viewer.registerCameraManipulator(new osgUtil::TrackballManipulator); diff --git a/src/osgPlugins/flt/OldVertexRecords.h b/src/osgPlugins/flt/OldVertexRecords.h index 313d1eb74..a61896903 100644 --- a/src/osgPlugins/flt/OldVertexRecords.h +++ b/src/osgPlugins/flt/OldVertexRecords.h @@ -8,13 +8,7 @@ #include "RecordVisitor.h" #include - -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using namespace std; -#endif namespace flt { @@ -46,7 +40,7 @@ class OldVertexRecord : public PrimNodeRecord virtual void accept(RecordVisitor& rv) { rv.apply(*this); } // virtual void traverse(RecordVisitor& rv); virtual SOldVertex* getData() const { return (SOldVertex*)_pData; } -// friend ostream& operator << (ostream& output, const OldVertexRecord& rec); +// friend std::ostream& operator << (std::ostream& output, const OldVertexRecord& rec); protected: virtual ~OldVertexRecord(); @@ -87,7 +81,7 @@ class OldVertexColorRecord : public PrimNodeRecord virtual void accept(RecordVisitor& rv) { rv.apply(*this); } // virtual void traverse(RecordVisitor& rv); virtual SOldVertexColor* getData() const { return (SOldVertexColor*)_pData; } -// friend ostream& operator << (ostream& output, const OldVertexColorRecord& rec); +// friend std::ostream& operator << (std::ostream& output, const OldVertexColorRecord& rec); protected: virtual ~OldVertexColorRecord(); @@ -128,7 +122,7 @@ class OldVertexColorNormalRecord : public PrimNodeRecord virtual void accept(RecordVisitor& rv) { rv.apply(*this); } // virtual void traverse(RecordVisitor& rv); virtual SOldVertexColorNormal* getData() const { return (SOldVertexColorNormal*)_pData; } -// friend ostream& operator << (ostream& output, const OldVertexColorNormalRecord& rec); +// friend std::ostream& operator << (std::ostream& output, const OldVertexColorNormalRecord& rec); protected: virtual ~OldVertexColorNormalRecord(); diff --git a/src/osgPlugins/flt/ReaderWriterATTR.cpp b/src/osgPlugins/flt/ReaderWriterATTR.cpp index 345850275..95616b94e 100644 --- a/src/osgPlugins/flt/ReaderWriterATTR.cpp +++ b/src/osgPlugins/flt/ReaderWriterATTR.cpp @@ -42,10 +42,6 @@ #include #include -#ifndef OSG_USE_IO_DOT_H -using std::ios; -#endif - typedef signed char int8; typedef unsigned char uint8; typedef signed short int16; @@ -161,7 +157,7 @@ class Attr Attr(int version) : _flt_version(version) { init(); } void init(); - void readField(ifstream& file, void* buf, size_t size); + void readField(std::ifstream& file, void* buf, size_t size); bool readAttrFile(const char* szName); StateSet* createOsgStateSet(); @@ -456,7 +452,7 @@ void Attr::init() } -void Attr::readField(ifstream& file, void* buf, size_t size) +void Attr::readField(std::ifstream& file, void* buf, size_t size) { if (file.eof()) return; file.read((char*)buf, size); @@ -468,9 +464,9 @@ void Attr::readField(ifstream& file, void* buf, size_t size) bool Attr::readAttrFile(const char* szName) { int n; - ifstream file; + std::ifstream file; - file.open (szName, ios::in | ios::binary); + file.open (szName, std::ios::in | std::ios::binary); READ( texels_u ); READ( textel_v ); diff --git a/src/osgPlugins/flt/Record.h b/src/osgPlugins/flt/Record.h index 1c47320ad..3a4f43913 100644 --- a/src/osgPlugins/flt/Record.h +++ b/src/osgPlugins/flt/Record.h @@ -9,12 +9,7 @@ #include "FltRecords.h" -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using namespace std; -#endif namespace flt { @@ -70,7 +65,7 @@ class Record : public osg::Referenced int getFlightVersion(); - friend ostream& operator << (ostream& output, const Record& rec); + friend std::ostream& operator << (std::ostream& output, const Record& rec); protected: diff --git a/src/osgPlugins/flt/VertexPoolRecords.h b/src/osgPlugins/flt/VertexPoolRecords.h index 05b42dacd..4fb891929 100644 --- a/src/osgPlugins/flt/VertexPoolRecords.h +++ b/src/osgPlugins/flt/VertexPoolRecords.h @@ -9,12 +9,7 @@ #include "Record.h" #include "RecordVisitor.h" -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using namespace std; -#endif namespace flt { @@ -48,7 +43,7 @@ class VertexPaletteRecord : public AncillaryRecord virtual size_t sizeofData() const { return sizeof(SVertexTableHeader); } virtual void accept(RecordVisitor& rv) { rv.apply(*this); } // virtual void traverse(RecordVisitor& rv); - friend ostream& operator << (ostream& output, const VertexPaletteRecord& rec); + friend std::ostream& operator << (std::ostream& output, const VertexPaletteRecord& rec); protected: virtual ~VertexPaletteRecord(); diff --git a/src/osgPlugins/flt/flt.h b/src/osgPlugins/flt/flt.h index 2ac4babb8..eb2a21cc2 100644 --- a/src/osgPlugins/flt/flt.h +++ b/src/osgPlugins/flt/flt.h @@ -4,12 +4,7 @@ #include -#ifdef OSG_USE_IO_DOT_H -#include -#else #include -using namespace std; -#endif namespace flt { @@ -81,7 +76,7 @@ struct float32x2 ENDIAN( _v[1] ); } - friend inline ostream& operator << (ostream& output, const float32x2& f) + friend inline std::ostream& operator << (std::ostream& output, const float32x2& f) { output << f._v[0] << " " << f._v[1]; @@ -103,7 +98,7 @@ struct float32x3 ENDIAN( _v[2] ); } - friend inline ostream& operator << (ostream& output, const float32x3& f) + friend inline std::ostream& operator << (std::ostream& output, const float32x3& f) { output << f._v[0] << " " << f._v[1] << " " @@ -124,7 +119,7 @@ struct float64x2 ENDIAN( _v[1] ); } - friend inline ostream& operator << (ostream& output, const float64x2& f) + friend inline std::ostream& operator << (std::ostream& output, const float64x2& f) { output << f._v[0] << " " << f._v[1]; @@ -147,7 +142,7 @@ struct float64x3 ENDIAN( _v[2] ); } - friend inline ostream& operator << (ostream& output, const float64x3& f) + friend inline std::ostream& operator << (std::ostream& output, const float64x3& f) { output << f._v[0] << " " << f._v[1] << " "