Hi Ulrich, Thanks. But wasn't easier to simply remove "domSourceReader::" in front of getArray<...>?
Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ----- "Robert Osfield" <[email protected]> a écrit : > Thanks Ulrich, changes now merge and submitted to svn/trunk. > > On Fri, Jan 28, 2011 at 4:43 AM, Ulrich Hertlein > <[email protected]> wrote: > > Hi, > > > > the changes from r12126 (see below) in dae/domSourceReader.h cause > compiler errors on OS X > > with gcc-4.2.1: > > > > In file included from > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/daeRAnimations.cpp:3: > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/domSourceReader.h:43: > error: > > explicit specialization in non-namespace scope 'class > osgDAE::domSourceReader' > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/domSourceReader.h:45: > error: > > explicit specialization in non-namespace scope 'class > osgDAE::domSourceReader' > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/domSourceReader.h:47: > error: > > explicit specialization in non-namespace scope 'class > osgDAE::domSourceReader' > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/domSourceReader.h:49: > error: > > explicit specialization in non-namespace scope 'class > osgDAE::domSourceReader' > > > /Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/dae/domSourceReader.h:51: > error: > > explicit specialization in non-namespace scope 'class > osgDAE::domSourceReader' > > ... > > > > The attached file fixes this. > > Cheers, > > /ulrich > > > > $ svn diff -c12126 domSourceReader.h > > @@ -38,22 +38,25 @@ > > > > - osg::FloatArray* getFloatArray() { if (srcInit) convert(false); > return > > m_float_array.get(); }; > > - > > - osg::Vec2Array* getVec2Array() { if (srcInit) convert(false); > return > > m_vec2_array.get(); }; > > + template <class OsgArrayType> > > + inline OsgArrayType * getArray(); > > + template <> > > + inline osg::FloatArray* > domSourceReader::getArray<osg::FloatArray>() { if (srcInit) > > convert(false); return m_float_array.get(); }; > > + template <> > > + inline osg::Vec2Array* > domSourceReader::getArray<osg::Vec2Array>() { if (srcInit) > > convert(false); return m_vec2_array.get(); }; > > + template <> > > + inline osg::Vec3Array* > domSourceReader::getArray<osg::Vec3Array>() { if (srcInit) > > convert(false); return m_vec3_array.get(); }; > > + template <> > > + inline osg::Vec4Array* > domSourceReader::getArray<osg::Vec4Array>() { if (srcInit) > > convert(false); return m_vec4_array.get(); }; > > + template <> > > + inline osg::Vec2dArray* > domSourceReader::getArray<osg::Vec2dArray>() { if (srcInit) > > convert(true); return m_vec2d_array.get(); }; > > + template <> > > + inline osg::Vec3dArray* > domSourceReader::getArray<osg::Vec3dArray>() { if (srcInit) > > convert(true); return m_vec3d_array.get(); }; > > + template <> > > + inline osg::Vec4dArray* > domSourceReader::getArray<osg::Vec4dArray>() { if (srcInit) > > convert(true); return m_vec4d_array.get(); }; > > + template <> > > + inline osg::MatrixfArray* > domSourceReader::getArray<osg::MatrixfArray>() { if > > (srcInit) convert(false); return m_matrix_array.get(); }; > > > > - osg::Vec3Array* getVec3Array() { if (srcInit) convert(false); > return > > m_vec3_array.get(); }; > > - > > - osg::Vec4Array* getVec4Array() { if (srcInit) convert(false); > return > > m_vec4_array.get(); }; > > - > > - osg::Vec2dArray* getVec2dArray() { if (srcInit) convert(true); > return > > m_vec2d_array.get(); }; > > - > > - osg::Vec3dArray* getVec3dArray() { if (srcInit) convert(true); > return > > m_vec3d_array.get(); }; > > - > > - osg::Vec4dArray* getVec4dArray() { if (srcInit) convert(true); > return > > m_vec4d_array.get(); }; > > - > > - osg::MatrixfArray* getMatrixArray() { if (srcInit) > convert(false); return > > m_matrix_array.get(); }; > > - > > int getCount(bool enableDoublePrecision) const { if (srcInit) > > const_cast<domSourceReader*>(this)->convert(enableDoublePrecision); > return m_count; }; > > > > #define ASSERT_TYPE(type) if (type!=m_array_type) { > OSG_WARN<<"Wrong array type > > requested ("#type" != "<<m_array_type<<")"<<std::endl; } > > > > _______________________________________________ > > osg-submissions mailing list > > [email protected] > > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
