From: Mikko Rasa Date: Thu, 11 Apr 2013 19:58:52 +0000 (+0300) Subject: Force some c'tors and d'tors to be emitted in the library X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=8b9d1625ac367114612b57a83901033ffc2bc7e0 Force some c'tors and d'tors to be emitted in the library Forward declaring class A and having a RefPtr to it in class B causes trouble if B's constructor or destructor is synthesized at a location where A's definition is not visible. --- diff --git a/source/animation.cpp b/source/animation.cpp index 8135cb59..255e63cc 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -17,6 +17,10 @@ Animation::Animation(): looping(false) { } +// Avoid synthesizing ~RefPtr in files including animation.h +Animation::~Animation() +{ } + void Animation::set_armature(const Armature &a) { armature = &a; diff --git a/source/animation.h b/source/animation.h index 6b890ea3..58a76583 100644 --- a/source/animation.h +++ b/source/animation.h @@ -100,6 +100,7 @@ private: public: Animation(); + ~Animation(); void set_armature(const Armature &); const Armature *get_armature() const { return armature; } diff --git a/source/font.cpp b/source/font.cpp index 53e3bd62..abfe631e 100644 --- a/source/font.cpp +++ b/source/font.cpp @@ -18,6 +18,10 @@ Font::Font(): descent(0) { } +// Avoid synthesizing ~RefPtr in files including font.h +Font::~Font() +{ } + void Font::set_texture(const Texture2D &t) { texture = &t; diff --git a/source/font.h b/source/font.h index 6f8f35ff..fe5a9b34 100644 --- a/source/font.h +++ b/source/font.h @@ -58,6 +58,7 @@ private: public: Font(); + ~Font(); void set_texture(const Texture2D &); const Texture2D &get_texture() const; diff --git a/source/keyframe.cpp b/source/keyframe.cpp index e0d35ad8..8e0d7904 100644 --- a/source/keyframe.cpp +++ b/source/keyframe.cpp @@ -7,6 +7,13 @@ using namespace std; namespace Msp { namespace GL { +// Avoid synthesizing RefPtr c'tor and d'tor in files including keyframe.h +KeyFrame::KeyFrame() +{ } + +KeyFrame::~KeyFrame() +{ } + void KeyFrame::set_matrix(const Matrix &m) { matrix = m; diff --git a/source/keyframe.h b/source/keyframe.h index ccfbda9a..6a8c5a44 100644 --- a/source/keyframe.h +++ b/source/keyframe.h @@ -37,6 +37,9 @@ private: RefPtr pose; public: + KeyFrame(); + ~KeyFrame(); + void set_matrix(const Matrix &); void set_pose(const Pose &); const Matrix &get_matrix() const { return matrix; } diff --git a/source/object.cpp b/source/object.cpp index ab7afc14..76999683 100644 --- a/source/object.cpp +++ b/source/object.cpp @@ -25,9 +25,9 @@ Object::Object(const Mesh *m, const Technique *t) set_technique(t); } +// Avoid synthesizing ~RefPtr in files including object.h Object::~Object() -{ -} +{ } void Object::set_mesh(unsigned i, const Mesh *m) {