diff --git a/applications/present3D/CMakeLists.txt b/applications/present3D/CMakeLists.txt index dfd9869a6..917c1d9e0 100644 --- a/applications/present3D/CMakeLists.txt +++ b/applications/present3D/CMakeLists.txt @@ -102,7 +102,15 @@ ENDIF() IF (WIN32) # to support cluster code SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} ws2_32) +ELSE() + CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" LIB_NSL_HAS_GETHOSTBYNAME) + IF(LIB_NSL_HAS_GETHOSTBYNAME) + SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} nsl) + ENDIF() + CHECK_LIBRARY_EXISTS("socket" "socket" "" LIB_SOCKET_HAS_SOCKET) + IF(LIB_SOCKET_HAS_SOCKET) + SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} socket) + ENDIF() ENDIF() - SETUP_APPLICATION(present3D) diff --git a/examples/osgQtWidgets/osgQtWidgets.cpp b/examples/osgQtWidgets/osgQtWidgets.cpp index 3a918c711..37fe4fe89 100644 --- a/examples/osgQtWidgets/osgQtWidgets.cpp +++ b/examples/osgQtWidgets/osgQtWidgets.cpp @@ -363,7 +363,9 @@ int main(int argc, char **argv) if (!sanityCheck) { osg::ref_ptr widgetImage = new osgQt::QWidgetImage(widget); +#if (QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)) widgetImage->getQWidget()->setAttribute(Qt::WA_TranslucentBackground); +#endif widgetImage->getQGraphicsViewAdapter()->setBackgroundColor(QColor(0, 0, 0, 0)); //widgetImage->getQGraphicsViewAdapter()->resize(800, 600); graphicsScene = widgetImage->getQGraphicsViewAdapter()->getQGraphicsScene(); diff --git a/examples/osgcluster/CMakeLists.txt b/examples/osgcluster/CMakeLists.txt index d003e4f33..5dc208732 100644 --- a/examples/osgcluster/CMakeLists.txt +++ b/examples/osgcluster/CMakeLists.txt @@ -6,6 +6,15 @@ SET(TARGET_SRC IF (WIN32) SET(TARGET_EXTERNAL_LIBRARIES ws2_32) +ELSE(WIN32) + CHECK_LIBRARY_EXISTS("nsl" "gethostbyname" "" LIB_NSL_HAS_GETHOSTBYNAME) + IF(LIB_NSL_HAS_GETHOSTBYNAME) + SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} nsl) + ENDIF() + CHECK_LIBRARY_EXISTS("socket" "socket" "" LIB_SOCKET_HAS_SOCKET) + IF(LIB_SOCKET_HAS_SOCKET) + SET(TARGET_EXTERNAL_LIBRARIES ${TARGET_EXTERNAL_LIBRARIES} socket) + ENDIF() ENDIF(WIN32) #### end var setup ### diff --git a/examples/osgmultiviewpaging/osgmultiviewpaging.cpp b/examples/osgmultiviewpaging/osgmultiviewpaging.cpp index e468acce4..49c6666c4 100644 --- a/examples/osgmultiviewpaging/osgmultiviewpaging.cpp +++ b/examples/osgmultiviewpaging/osgmultiviewpaging.cpp @@ -40,8 +40,6 @@ #include -#include - #include class MyPager : public osgDB::DatabasePager diff --git a/examples/osgtext3D/TextNode.cpp b/examples/osgtext3D/TextNode.cpp index 913d9da16..5c39da1e2 100644 --- a/examples/osgtext3D/TextNode.cpp +++ b/examples/osgtext3D/TextNode.cpp @@ -227,7 +227,7 @@ void TextTechnique::finish() void TextTechnique::traverse(osg::NodeVisitor& nv) { // OSG_NOTICE<<"TextTechnique::traverse()"<Group::traverse(nv); + if (_textNode) _textNode->osg::Group::traverse(nv); } ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/include/osg/State b/include/osg/State index c8a1c11cf..89477e2fd 100644 --- a/include/osg/State +++ b/include/osg/State @@ -30,6 +30,7 @@ #include #include +#include #include #include #include diff --git a/include/osgText/Style b/include/osgText/Style index 4010006f2..397879b08 100644 --- a/include/osgText/Style +++ b/include/osgText/Style @@ -18,6 +18,7 @@ #include #include +#include #include namespace osgText diff --git a/src/OpenThreads/pthreads/PThread.c++ b/src/OpenThreads/pthreads/PThread.c++ index 0f46a138d..ca9201312 100644 --- a/src/OpenThreads/pthreads/PThread.c++ +++ b/src/OpenThreads/pthreads/PThread.c++ @@ -594,8 +594,10 @@ int Thread::start() { // value. // if(pd->stackSize) { +#ifdef PTHREAD_STACK_MIN if(pd->stackSize < PTHREAD_STACK_MIN) pd->stackSize = PTHREAD_STACK_MIN; +#endif pthread_attr_setstacksize( &thread_attr, pd->stackSize); if(status != 0) { return status; diff --git a/src/osgGA/MultiTouchTrackballManipulator.cpp b/src/osgGA/MultiTouchTrackballManipulator.cpp index 148e6fa1c..8793ffbf4 100644 --- a/src/osgGA/MultiTouchTrackballManipulator.cpp +++ b/src/osgGA/MultiTouchTrackballManipulator.cpp @@ -51,7 +51,7 @@ void MultiTouchTrackballManipulator::handleMultiTouchDrag(GUIEventAdapter::Touch // osg::notify(osg::ALWAYS) << gap_now << " " << gap_last << std::endl; - if (abs(gap_last - gap_now) >= zoom_threshold) + if (fabs(gap_last - gap_now) >= zoom_threshold) { // zoom gesture zoomModel( (gap_last - gap_now) * eventTimeDelta, true ); @@ -131,4 +131,4 @@ bool MultiTouchTrackballManipulator::handle( const GUIEventAdapter& ea, GUIActio } return handled ? handled : TrackballManipulator::handle(ea, us); -} \ No newline at end of file +} diff --git a/src/osgPlugins/3ds/lib3ds/lib3ds_impl.h b/src/osgPlugins/3ds/lib3ds/lib3ds_impl.h index 1c12e66c2..b3c90c17f 100644 --- a/src/osgPlugins/3ds/lib3ds/lib3ds_impl.h +++ b/src/osgPlugins/3ds/lib3ds/lib3ds_impl.h @@ -35,7 +35,11 @@ #endif #ifndef _MSC_VER +#if defined __sun || defined __hpux +#include +#else #include +#endif #else typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; diff --git a/src/osgPlugins/pvr/ReaderWriterPVR.cpp b/src/osgPlugins/pvr/ReaderWriterPVR.cpp index 4150c6715..8956a1626 100644 --- a/src/osgPlugins/pvr/ReaderWriterPVR.cpp +++ b/src/osgPlugins/pvr/ReaderWriterPVR.cpp @@ -27,8 +27,12 @@ typedef INT32 int32_t; typedef UINT16 uint16_t; typedef UINT8 uint8_t; #else +#if defined __sun || defined __hpux +#include +#else #include #endif +#endif using namespace osg; diff --git a/src/osgUtil/IncrementalCompileOperation.cpp b/src/osgUtil/IncrementalCompileOperation.cpp index cf877ae4c..349130d65 100644 --- a/src/osgUtil/IncrementalCompileOperation.cpp +++ b/src/osgUtil/IncrementalCompileOperation.cpp @@ -706,9 +706,9 @@ void IncrementalCompileOperation::CompileSet::buildCompileMap(ContextSet& contex ++itr) { CompileData& cd = _compileMap[*itr]; - cd._drawables.insert(cstc._drawables.begin(), cstc._drawables.end()); - cd._textures.insert(cstc._textures.begin(), cstc._textures.end()); - cd._programs.insert(cstc._programs.begin(), cstc._programs.end()); + std::copy(cstc._drawables.begin(), cstc._drawables.end(), std::inserter(cd._drawables, cd._drawables.end())); + std::copy(cstc._textures.begin(), cstc._textures.end(), std::inserter(cd._textures, cd._textures.end())); + std::copy(cstc._programs.begin(), cstc._programs.end(), std::inserter(cd._programs, cd._programs.end())); } } diff --git a/src/osgWidget/Input.cpp b/src/osgWidget/Input.cpp index 464a03a4a..2a9d3f891 100644 --- a/src/osgWidget/Input.cpp +++ b/src/osgWidget/Input.cpp @@ -524,7 +524,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*) data = data.substr(0, _maxSize-s.size()-(deleteMax - deleteMin)); s.erase(s.begin() + deleteMin, s.begin() + deleteMax); - s.insert(s.begin() + deleteMin, data.begin(), data.end()); + std::copy(data.begin(), data.end(), std::inserter(s, s.begin() + deleteMin)); _index = deleteMin + data.size(); } @@ -532,7 +532,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*) { data = data.substr(0, _maxSize-s.size()); - s.insert(s.begin() + _index, data.begin(), data.end()); + std::copy(data.begin(), data.end(), std::inserter(s, s.begin() + _index)); _index += data.length(); } @@ -558,7 +558,7 @@ bool Input::keyDown(int key, int mask, const WindowManager*) if (selectionMax - selectionMin > 0) { std::string data; - data.insert(data.begin(), s.begin() + selectionMin, s.begin() + selectionMax); + std::copy(s.begin() + selectionMin, s.begin() + selectionMax, std::inserter(data, data.begin())); // Data to clipboard #ifdef WIN32