From c7e8386707cc6af33e1e30b1cf44e94f709ffba4 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Mon, 29 Nov 2004 01:12:25 +0000 Subject: [PATCH] Fixes for IRIX build --- examples/osgfxbrowser/osgfxbrowser.cpp | 2 +- examples/osglauncher/osglauncher.cpp | 4 ++-- include/osgDB/ImageOptions | 2 +- include/osgDB/ReaderWriter | 5 +++-- include/osgDB/ReentrantMutex | 2 +- src/osgDB/ReentrantMutex.cpp | 6 +++--- src/osgPlugins/flt/ReaderWriterFLT.cpp | 6 +++--- src/osgPlugins/net/sockinet.cpp | 10 +++++++++- src/osgPlugins/net/sockstream.cpp | 7 ++++++- src/osgPlugins/net/sockstream.h | 3 --- 10 files changed, 29 insertions(+), 18 deletions(-) diff --git a/examples/osgfxbrowser/osgfxbrowser.cpp b/examples/osgfxbrowser/osgfxbrowser.cpp index 838b219a5..da98c1d05 100644 --- a/examples/osgfxbrowser/osgfxbrowser.cpp +++ b/examples/osgfxbrowser/osgfxbrowser.cpp @@ -93,7 +93,7 @@ public: }; EffectPanel() - : Frame(), + : osgfxbrowser::Frame(), selected_fx_(-1), fxen_(true), root_(new osg::Group), diff --git a/examples/osglauncher/osglauncher.cpp b/examples/osglauncher/osglauncher.cpp index 0b3d55dfb..ff5896e26 100644 --- a/examples/osglauncher/osglauncher.cpp +++ b/examples/osglauncher/osglauncher.cpp @@ -1,5 +1,5 @@ -#include -#include +//#include +//#include #include #include #include diff --git a/include/osgDB/ImageOptions b/include/osgDB/ImageOptions index 1e048b685..6cbb5088e 100644 --- a/include/osgDB/ImageOptions +++ b/include/osgDB/ImageOptions @@ -27,7 +27,7 @@ class OSGDB_EXPORT ImageOptions : public osgDB::ReaderWriter::Options ImageOptions(const std::string& str); ImageOptions(const ImageOptions& options,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): - Options(options,copyop), + osgDB::ReaderWriter::Options(options,copyop), _sourceImageSamplingMode(options._sourceImageSamplingMode), _sourceImageWindowMode(options._sourceImageWindowMode), _sourceRatioWindow(options._sourceRatioWindow), diff --git a/include/osgDB/ReaderWriter b/include/osgDB/ReaderWriter index 1d250bf6f..755a65e6a 100644 --- a/include/osgDB/ReaderWriter +++ b/include/osgDB/ReaderWriter @@ -37,7 +37,8 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object ReaderWriter() {} - ReaderWriter(const ReaderWriter& rw,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY):Object(rw,copyop) {} + ReaderWriter(const ReaderWriter& rw,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): + osg::Object(rw,copyop) {} virtual ~ReaderWriter(); @@ -84,7 +85,7 @@ class OSGDB_EXPORT ReaderWriter : public osg::Object Options(const std::string& str):_str(str) {} Options(const Options& options,const osg::CopyOp copyop=osg::CopyOp::SHALLOW_COPY): - Object(options,copyop), + osg::Object(options,copyop), _str(options._str), _databasePaths(options._databasePaths), _objectCacheHint(options._objectCacheHint) {} diff --git a/include/osgDB/ReentrantMutex b/include/osgDB/ReentrantMutex index 43871a5b2..7fb09ae86 100644 --- a/include/osgDB/ReentrantMutex +++ b/include/osgDB/ReentrantMutex @@ -37,7 +37,7 @@ class OSGDB_EXPORT ReentrantMutex : public OpenThreads::Mutex private: - ReentrantMutex(const ReentrantMutex &):Mutex() {} + ReentrantMutex(const ReentrantMutex &):OpenThreads::Mutex() {} ReentrantMutex &operator=(const ReentrantMutex &) {return *(this);} diff --git a/src/osgDB/ReentrantMutex.cpp b/src/osgDB/ReentrantMutex.cpp index c4e051d99..cbb0e1492 100644 --- a/src/osgDB/ReentrantMutex.cpp +++ b/src/osgDB/ReentrantMutex.cpp @@ -35,7 +35,7 @@ int ReentrantMutex::lock() } else { - int result = Mutex::lock(); + int result = OpenThreads::Mutex::lock(); if (result==0) { _threadHoldingMutex = OpenThreads::Thread::CurrentThread(); @@ -50,7 +50,7 @@ int ReentrantMutex::unlock() if (_threadHoldingMutex==OpenThreads::Thread::CurrentThread() && _lockCount>0) { --_lockCount; - if (_lockCount<=0) return Mutex::unlock(); + if (_lockCount<=0) return OpenThreads::Mutex::unlock(); } return 0; } @@ -64,7 +64,7 @@ int ReentrantMutex::trylock() } else { - int result = Mutex::trylock(); + int result = OpenThreads::Mutex::trylock(); if (result==0) { _threadHoldingMutex = OpenThreads::Thread::CurrentThread(); diff --git a/src/osgPlugins/flt/ReaderWriterFLT.cpp b/src/osgPlugins/flt/ReaderWriterFLT.cpp index 02f4e0b07..69296d585 100644 --- a/src/osgPlugins/flt/ReaderWriterFLT.cpp +++ b/src/osgPlugins/flt/ReaderWriterFLT.cpp @@ -57,9 +57,9 @@ osgDB::ReaderWriter::ReadResult ReaderWriterFLT::readNode(const std::string& fil } - osg::ref_ptr local_options = options ? - static_cast(options->clone(osg::CopyOp(osg::CopyOp::SHALLOW_COPY))) : - new ReaderWriter::Options; + osg::ref_ptr local_options = options ? + static_cast(options->clone(osg::CopyOp(osg::CopyOp::SHALLOW_COPY))) : + new osgDB::ReaderWriter::Options; local_options->setDatabasePath(osgDB::getFilePath(fileName)); read->setOptions(local_options.get()); diff --git a/src/osgPlugins/net/sockinet.cpp b/src/osgPlugins/net/sockinet.cpp index 585bce0d4..cce19de55 100644 --- a/src/osgPlugins/net/sockinet.cpp +++ b/src/osgPlugins/net/sockinet.cpp @@ -34,7 +34,7 @@ // The constructors of isockinet, osockinet and iosockinet are changed. #include "sockinet.h" -#if defined(__APPLE__) +#if defined(__APPLE__) typedef int socklen_t; #endif @@ -163,7 +163,11 @@ sockinetaddr sockinetbuf::localaddr() const { sockinetaddr sin; int len = sin.size(); +#ifdef __sgi + if (::getsockname(rep->sock, sin.addr (), (int *) // LN +#else if (::getsockname(rep->sock, sin.addr (), (socklen_t*) // LN +#endif &len) == -1) throw sockerr (errno, "sockinetbuf::localaddr"); return sin; @@ -187,7 +191,11 @@ sockinetaddr sockinetbuf::peeraddr() const { sockinetaddr sin; int len = sin.size(); +#ifdef __sgi + if (::getpeername(rep->sock, sin.addr (), (int *) // LN +#else if (::getpeername(rep->sock, sin.addr (), (socklen_t*) // LN +#endif &len) == -1) throw sockerr (errno, "sockinetbuf::peeraddr"); return sin; diff --git a/src/osgPlugins/net/sockstream.cpp b/src/osgPlugins/net/sockstream.cpp index ff3458400..b05b20edf 100644 --- a/src/osgPlugins/net/sockstream.cpp +++ b/src/osgPlugins/net/sockstream.cpp @@ -63,7 +63,8 @@ #include "sockstream.h" #include #include -#if defined(__APPLE__) + +#if defined(__APPLE__) typedef int socklen_t; #endif @@ -128,6 +129,10 @@ extern "C" { #include #endif +#ifdef __sgi +#define socklen_t int +#endif + #ifndef BUFSIZ # define BUFSIZ 1024 #endif diff --git a/src/osgPlugins/net/sockstream.h b/src/osgPlugins/net/sockstream.h index 5227cdf4a..4e13a4eb6 100644 --- a/src/osgPlugins/net/sockstream.h +++ b/src/osgPlugins/net/sockstream.h @@ -54,9 +54,6 @@ #endif #endif -#ifdef __sgi -typedef int socklen_t; -#endif using namespace std;