Here's a small patch to allow OpenSG2 to compile with gcc 4.6. It also allows using a newer boost (which has filesystem v3 as default) and adds a couple missing compatibility wrappers for GeoPositions and GeoNormals.

The OpenSG headers, at least, also almost compile with g++-4.6 -std=c++0x, except for one error:

/mnt/hdpsbin/dev/OpenSG-2.0/include/OpenSG/OSGFieldContainer.inl: In function 'ContainerPtr OSG::convertToCurrentAspect(ContainerPtr) [with ContainerPtr = OSG::MemoryObject*]': /mnt/hdpsbin/dev/OpenSG-2.0/include/OpenSG/OSGMemObjPointerMFieldCommon.inl:504:66: instantiated from here /mnt/hdpsbin/dev/OpenSG-2.0/include/OpenSG/OSGFieldContainer.inl:528:58: error: 'class OSG::MemoryObject' has no member named 'getAspectPtr'

Where it seems to be passing a MemoryObject* where a FieldContainer* is expected.
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/Base/FieldContainer/Node/OSGNode.h
--- a/Source/Base/FieldContainer/Node/OSGNode.h	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/Base/FieldContainer/Node/OSGNode.h	Fri Apr 08 12:13:53 2011 -0700
@@ -54,6 +54,7 @@
 #include "OSGNodeCoreFields.h"
 #include "OSGFieldContainerFactory.h"
 
+#include "OSGAttachment.h"
 #include <boost/assign/list_of.hpp>
 
 OSG_BEGIN_NAMESPACE
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/Base/Threading/OSGBarrier.inl
--- a/Source/Base/Threading/OSGBarrier.inl	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/Base/Threading/OSGBarrier.inl	Fri Apr 08 12:13:53 2011 -0700
@@ -103,7 +103,7 @@
     numWaiting = _uiCount;
     pthread_mutex_unlock(&(_pLockOne));
 
-    return _uiCount;
+    return numWaiting;
 }
 
 #endif /* OSG_USE_PTHREADS */
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/Contrib/BackgroundLoader/testBackgroundLoader.cpp
--- a/Source/Contrib/BackgroundLoader/testBackgroundLoader.cpp	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/Contrib/BackgroundLoader/testBackgroundLoader.cpp	Fri Apr 08 12:13:53 2011 -0700
@@ -12,6 +12,9 @@
 // the general scene file loading handler
 #include "OSGSceneFileHandler.h"
 #include "OSGFieldContainerFactory.h"
+
+#define BOOST_FILESYSTEM_VERSION 2
+
 #include <boost/bind.hpp>
 #include <boost/filesystem/operations.hpp>
 #include <boost/filesystem/fstream.hpp>
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/Contrib/PLY/OSGply.cpp
--- a/Source/Contrib/PLY/OSGply.cpp	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/Contrib/PLY/OSGply.cpp	Fri Apr 08 12:13:53 2011 -0700
@@ -35,6 +35,7 @@
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <math.h>
 #include <string.h>
 
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/System/Depreciated/State/OSGTextureChunk.cpp
--- a/Source/System/Depreciated/State/OSGTextureChunk.cpp	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/System/Depreciated/State/OSGTextureChunk.cpp	Fri Apr 08 12:13:53 2011 -0700
@@ -2553,13 +2553,13 @@
 
         returnValue &=
            ((        getEnvScaleRGB  () - tother->getEnvScaleRGB  ()) <
-            TypeTraits<Real>::getDefaultEps()                          ) &&
+            TypeTraits<Real32>::getDefaultEps()                          ) &&
            ((tother->getEnvScaleRGB  () -         getEnvScaleRGB  ()) <
-            TypeTraits<Real>::getDefaultEps()                          ) &&
+            TypeTraits<Real32>::getDefaultEps()                          ) &&
            ((        getEnvScaleAlpha() - tother->getEnvScaleAlpha()) <
-            TypeTraits<Real>::getDefaultEps()                          ) &&
+            TypeTraits<Real32>::getDefaultEps()                          ) &&
            ((tother->getEnvScaleAlpha() -         getEnvScaleAlpha()) <
-            TypeTraits<Real>::getDefaultEps()                          );
+            TypeTraits<Real32>::getDefaultEps()                          );
 
 
     }
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoNormalsFields.h
--- a/Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoNormalsFields.h	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoNormalsFields.h	Fri Apr 08 12:13:53 2011 -0700
@@ -51,6 +51,8 @@
 
 typedef SFUnrecGeoVectorPropertyPtr SFGeoNormalsPtr;
 typedef SFUnrecGeoVectorPropertyPtr SFUnrecGeoNormalsPtr;
+typedef MFUnrecGeoVectorPropertyPtr MFGeoNormalsPtr;
+typedef MFUnrecGeoVectorPropertyPtr MFUnrecGeoNormalsPtr;
 
 OSG_END_NAMESPACE
 
diff -r 3bc33a718bb6 -r d18d6b532d64 Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoPositionsFields.h
--- a/Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoPositionsFields.h	Thu Apr 07 19:59:12 2011 +0800
+++ b/Source/System/NodeCores/Drawables/Geometry/Wrapper/OSGGeoPositionsFields.h	Fri Apr 08 12:13:53 2011 -0700
@@ -51,6 +51,8 @@
 
 typedef SFUnrecGeoVectorPropertyPtr SFGeoPositionsPtr;
 typedef SFUnrecGeoVectorPropertyPtr SFUnrecGeoPositionsPtr;
+typedef MFUnrecGeoVectorPropertyPtr MFGeoPositionsPtr;
+typedef MFUnrecGeoVectorPropertyPtr MFUnrecGeoPositionsPtr;
 
 OSG_END_NAMESPACE
 
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to