From c4f321d91120a9cbd9269a0cf6e542447f4dd3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 22 Oct 2012 17:46:06 +0200 Subject: [PATCH] Don't use extern template where it is not necessary. Extern template probably causes even inline functions to be instantiated, because MinGW's GCC 4.7.0 then complains about conflicting symbols, removing them fixes the issue. Extern template is not necessary here, as the needed functions are explicitly instantiated in source file only anyway and we don't care about instantiation count of inline functions. --- src/BufferedImage.h | 8 +------- src/Physics/AbstractShape.h | 5 ----- src/Physics/AxisAlignedBox.h | 5 ----- src/Physics/Box.h | 5 ----- src/Physics/Capsule.h | 5 ----- src/Physics/Line.h | 5 ----- src/Physics/Point.h | 5 ----- src/Physics/ShapeGroup.h | 5 ----- src/Physics/ShapedObject.h | 5 ----- src/Physics/ShapedObjectGroup.h | 5 ----- src/Physics/Sphere.h | 5 ----- src/SceneGraph/Camera.h | 4 ---- src/SceneGraph/Object.h | 6 ------ 13 files changed, 1 insertion(+), 67 deletions(-) diff --git a/src/BufferedImage.h b/src/BufferedImage.h index f950b9636..b3c60244a 100644 --- a/src/BufferedImage.h +++ b/src/BufferedImage.h @@ -36,7 +36,7 @@ Trade::ImageData. @see BufferedImage1D, BufferedImage2D, BufferedImage3D, Buffer @requires_gles30 (no extension providing this functionality) */ -template class BufferedImage: public AbstractImage { +template class MAGNUM_EXPORT BufferedImage: public AbstractImage { public: const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */ @@ -109,12 +109,6 @@ template class BufferedImage: public AbstractImage { Buffer _buffer; /**< @brief %Image buffer */ }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class MAGNUM_EXPORT BufferedImage<1>; -extern template class MAGNUM_EXPORT BufferedImage<2>; -extern template class MAGNUM_EXPORT BufferedImage<3>; -#endif - /** @brief One-dimensional buffered image */ typedef BufferedImage<1> BufferedImage1D; diff --git a/src/Physics/AbstractShape.h b/src/Physics/AbstractShape.h index 479482ad4..6ac3bdf25 100644 --- a/src/Physics/AbstractShape.h +++ b/src/Physics/AbstractShape.h @@ -118,11 +118,6 @@ template class PHYSICS_EXPORT AbstractShape { virtual bool collides(const AbstractShape* other) const; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT AbstractShape<2>; -extern template class PHYSICS_EXPORT AbstractShape<3>; -#endif - /** @brief Abstract two-dimensional shape */ typedef AbstractShape<2> AbstractShape2D; diff --git a/src/Physics/AxisAlignedBox.h b/src/Physics/AxisAlignedBox.h index c007c8ea6..bff023255 100644 --- a/src/Physics/AxisAlignedBox.h +++ b/src/Physics/AxisAlignedBox.h @@ -73,11 +73,6 @@ template class PHYSICS_EXPORT AxisAlignedBox: public Ab _size, _transformedSize; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT AxisAlignedBox<2>; -extern template class PHYSICS_EXPORT AxisAlignedBox<3>; -#endif - /** @brief Two-dimensional axis-aligned box */ typedef AxisAlignedBox<2> AxisAlignedBox2D; diff --git a/src/Physics/Box.h b/src/Physics/Box.h index 896adaa67..d70aac3ab 100644 --- a/src/Physics/Box.h +++ b/src/Physics/Box.h @@ -61,11 +61,6 @@ template class PHYSICS_EXPORT Box: public AbstractShape _transformedTransformation; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT Box<2>; -extern template class PHYSICS_EXPORT Box<3>; -#endif - /** @brief Two-dimensional box */ typedef Box<2> Box2D; diff --git a/src/Physics/Capsule.h b/src/Physics/Capsule.h index eb059b13e..7e20a9814 100644 --- a/src/Physics/Capsule.h +++ b/src/Physics/Capsule.h @@ -100,11 +100,6 @@ template class PHYSICS_EXPORT Capsule: public AbstractS float _radius, _transformedRadius; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT Capsule<2>; -extern template class PHYSICS_EXPORT Capsule<3>; -#endif - /** @brief Two-dimensional capsule */ typedef Capsule<2> Capsule2D; diff --git a/src/Physics/Line.h b/src/Physics/Line.h index 21c0c31ae..9f16e3d2b 100644 --- a/src/Physics/Line.h +++ b/src/Physics/Line.h @@ -76,11 +76,6 @@ template class PHYSICS_EXPORT Line: public AbstractShap _b, _transformedB; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT Line<2>; -extern template class PHYSICS_EXPORT Line<3>; -#endif - /** @brief Infinite two-dimensional line */ typedef Line<2> Line2D; diff --git a/src/Physics/Point.h b/src/Physics/Point.h index 0644c85d9..9f867762c 100644 --- a/src/Physics/Point.h +++ b/src/Physics/Point.h @@ -59,11 +59,6 @@ template class PHYSICS_EXPORT Point: public AbstractSha Math::Vector _position, _transformedPosition; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT Point<2>; -extern template class PHYSICS_EXPORT Point<3>; -#endif - /** @brief Two-dimensional point */ typedef Point<2> Point2D; diff --git a/src/Physics/ShapeGroup.h b/src/Physics/ShapeGroup.h index 505cb3309..de8ab7fd8 100644 --- a/src/Physics/ShapeGroup.h +++ b/src/Physics/ShapeGroup.h @@ -129,11 +129,6 @@ template class PHYSICS_EXPORT ShapeGroup: public Abstra AbstractShape* b; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT ShapeGroup<2>; -extern template class PHYSICS_EXPORT ShapeGroup<3>; -#endif - /** @brief Two-dimensional shape group */ typedef ShapeGroup<2> ShapeGroup2D; diff --git a/src/Physics/ShapedObject.h b/src/Physics/ShapedObject.h index e7e2aac9e..b9763270f 100644 --- a/src/Physics/ShapedObject.h +++ b/src/Physics/ShapedObject.h @@ -86,11 +86,6 @@ template class PHYSICS_EXPORT ShapedObject: public Scen AbstractShape* _shape; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT ShapedObject<2>; -extern template class PHYSICS_EXPORT ShapedObject<3>; -#endif - /** @brief Two-dimensional shaped object */ typedef ShapedObject<2> ShapedObject2D; diff --git a/src/Physics/ShapedObjectGroup.h b/src/Physics/ShapedObjectGroup.h index bf1f00f0c..7654a1286 100644 --- a/src/Physics/ShapedObjectGroup.h +++ b/src/Physics/ShapedObjectGroup.h @@ -79,11 +79,6 @@ template class PHYSICS_EXPORT ShapedObjectGroup { bool dirty; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT ShapedObjectGroup<2>; -extern template class PHYSICS_EXPORT ShapedObjectGroup<3>; -#endif - /** @brief Group of two-dimensional shaped objects */ typedef ShapedObjectGroup<2> ShapedObjectGroup2D; diff --git a/src/Physics/Sphere.h b/src/Physics/Sphere.h index 36992346e..245ed9a4c 100644 --- a/src/Physics/Sphere.h +++ b/src/Physics/Sphere.h @@ -92,11 +92,6 @@ template class PHYSICS_EXPORT Sphere: public AbstractSh float _radius, _transformedRadius; }; -#ifndef DOXYGEN_GENERATING_OUTPUT -extern template class PHYSICS_EXPORT Sphere<2>; -extern template class PHYSICS_EXPORT Sphere<3>; -#endif - /** @brief Two-dimensional sphere */ typedef Sphere<2> Sphere2D; diff --git a/src/SceneGraph/Camera.h b/src/SceneGraph/Camera.h index 6f8c68bbb..69427db5c 100644 --- a/src/SceneGraph/Camera.h +++ b/src/SceneGraph/Camera.h @@ -161,10 +161,6 @@ template class SCENEGRAPH_EXPORT AbstractCamera: public template inline AbstractCamera::~AbstractCamera() {} #ifndef DOXYGEN_GENERATING_OUTPUT -/* These templates are instantiated in source file */ -extern template class SCENEGRAPH_EXPORT AbstractCamera<2>; -extern template class SCENEGRAPH_EXPORT AbstractCamera<3>; - namespace Implementation { template class Camera {}; diff --git a/src/SceneGraph/Object.h b/src/SceneGraph/Object.h index cd1d929fe..86d10a5a0 100644 --- a/src/SceneGraph/Object.h +++ b/src/SceneGraph/Object.h @@ -312,12 +312,6 @@ template inline AbstractObject::~AbstractOb template inline void AbstractObject::draw(const typename DimensionTraits::MatrixType&, CameraType*) {} template inline void AbstractObject::clean(const typename DimensionTraits::MatrixType&) { dirty = false; } -#ifndef DOXYGEN_GENERATING_OUTPUT -/* These templates are instantiated in source file */ -extern template class SCENEGRAPH_EXPORT AbstractObject<2>; -extern template class SCENEGRAPH_EXPORT AbstractObject<3>; -#endif - /** @brief Two-dimensional object