From 523b77ee8f4ad63973ebaa2e5478252488a36a11 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 Jan 2011 10:53:49 +0000 Subject: [PATCH] From Ulrich Hertlien, "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." --- src/osgPlugins/dae/domSourceReader.h | 81 ++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 17 deletions(-) diff --git a/src/osgPlugins/dae/domSourceReader.h b/src/osgPlugins/dae/domSourceReader.h index 846dfb4b5..89bcc6be6 100644 --- a/src/osgPlugins/dae/domSourceReader.h +++ b/src/osgPlugins/dae/domSourceReader.h @@ -40,22 +40,6 @@ public: template inline OsgArrayType * getArray(); - template <> - inline osg::FloatArray* domSourceReader::getArray() { if (srcInit) convert(false); return m_float_array.get(); }; - template <> - inline osg::Vec2Array* domSourceReader::getArray() { if (srcInit) convert(false); return m_vec2_array.get(); }; - template <> - inline osg::Vec3Array* domSourceReader::getArray() { if (srcInit) convert(false); return m_vec3_array.get(); }; - template <> - inline osg::Vec4Array* domSourceReader::getArray() { if (srcInit) convert(false); return m_vec4_array.get(); }; - template <> - inline osg::Vec2dArray* domSourceReader::getArray() { if (srcInit) convert(true); return m_vec2d_array.get(); }; - template <> - inline osg::Vec3dArray* domSourceReader::getArray() { if (srcInit) convert(true); return m_vec3d_array.get(); }; - template <> - inline osg::Vec4dArray* domSourceReader::getArray() { if (srcInit) convert(true); return m_vec4d_array.get(); }; - template <> - inline osg::MatrixfArray* domSourceReader::getArray() { if (srcInit) convert(false); return m_matrix_array.get(); }; int getCount(bool enableDoublePrecision) const { if (srcInit) const_cast(this)->convert(enableDoublePrecision); return m_count; }; @@ -96,9 +80,72 @@ protected: osg::ref_ptr m_vec3d_array; osg::ref_ptr m_vec4d_array; osg::ref_ptr m_matrix_array; - }; +template <> +inline osg::FloatArray* domSourceReader::getArray() +{ + if (srcInit) + convert(false); + return m_float_array.get(); +} + +template <> +inline osg::Vec2Array* domSourceReader::getArray() +{ + if (srcInit) + convert(false); + return m_vec2_array.get(); +} + +template <> +inline osg::Vec3Array* domSourceReader::getArray() +{ + if (srcInit) + convert(false); + return m_vec3_array.get(); +} + +template <> +inline osg::Vec4Array* domSourceReader::getArray() +{ + if (srcInit) + convert(false); + return m_vec4_array.get(); +} + +template <> +inline osg::Vec2dArray* domSourceReader::getArray() +{ + if (srcInit) + convert(true); + return m_vec2d_array.get(); +} + +template <> +inline osg::Vec3dArray* domSourceReader::getArray() +{ + if (srcInit) + convert(true); + return m_vec3d_array.get(); +} + +template <> +inline osg::Vec4dArray* domSourceReader::getArray() +{ + if (srcInit) + convert(true); + return m_vec4d_array.get(); +} + +template <> +inline osg::MatrixfArray* domSourceReader::getArray() +{ + if (srcInit) + convert(false); + return m_matrix_array.get(); +} + } #endif