Browse Source

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.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
c4f321d911
  1. 8
      src/BufferedImage.h
  2. 5
      src/Physics/AbstractShape.h
  3. 5
      src/Physics/AxisAlignedBox.h
  4. 5
      src/Physics/Box.h
  5. 5
      src/Physics/Capsule.h
  6. 5
      src/Physics/Line.h
  7. 5
      src/Physics/Point.h
  8. 5
      src/Physics/ShapeGroup.h
  9. 5
      src/Physics/ShapedObject.h
  10. 5
      src/Physics/ShapedObjectGroup.h
  11. 5
      src/Physics/Sphere.h
  12. 4
      src/SceneGraph/Camera.h
  13. 6
      src/SceneGraph/Object.h

8
src/BufferedImage.h

@ -36,7 +36,7 @@ Trade::ImageData.
@see BufferedImage1D, BufferedImage2D, BufferedImage3D, Buffer
@requires_gles30 (no extension providing this functionality)
*/
template<std::uint8_t dimensions> class BufferedImage: public AbstractImage {
template<std::uint8_t dimensions> class MAGNUM_EXPORT BufferedImage: public AbstractImage {
public:
const static std::uint8_t Dimensions = dimensions; /**< @brief %Image dimension count */
@ -109,12 +109,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/AbstractShape.h

@ -118,11 +118,6 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT AbstractShape {
virtual bool collides(const AbstractShape<dimensions>* 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;

5
src/Physics/AxisAlignedBox.h

@ -73,11 +73,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/Box.h

@ -61,11 +61,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/Capsule.h

@ -100,11 +100,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/Line.h

@ -76,11 +76,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/Point.h

@ -59,11 +59,6 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT Point: public AbstractSha
Math::Vector<dimensions, GLfloat> _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;

5
src/Physics/ShapeGroup.h

@ -129,11 +129,6 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT ShapeGroup: public Abstra
AbstractShape<dimensions>* 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;

5
src/Physics/ShapedObject.h

@ -86,11 +86,6 @@ template<std::uint8_t dimensions> class PHYSICS_EXPORT ShapedObject: public Scen
AbstractShape<dimensions>* _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;

5
src/Physics/ShapedObjectGroup.h

@ -79,11 +79,6 @@ template<std::uint8_t dimensions> 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;

5
src/Physics/Sphere.h

@ -92,11 +92,6 @@ template<std::uint8_t dimensions> 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;

4
src/SceneGraph/Camera.h

@ -161,10 +161,6 @@ template<std::uint8_t dimensions> class SCENEGRAPH_EXPORT AbstractCamera: public
template<std::uint8_t dimensions> inline AbstractCamera<dimensions>::~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<std::uint8_t dimensions> class Camera {};

6
src/SceneGraph/Object.h

@ -312,12 +312,6 @@ template<std::uint8_t dimensions> inline AbstractObject<dimensions>::~AbstractOb
template<std::uint8_t dimensions> inline void AbstractObject<dimensions>::draw(const typename DimensionTraits<dimensions, GLfloat>::MatrixType&, CameraType*) {}
template<std::uint8_t dimensions> inline void AbstractObject<dimensions>::clean(const typename DimensionTraits<dimensions, GLfloat>::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

Loading…
Cancel
Save