Patch: make clanlib 0.8.1 clanDIsplay-0.8.so.1 ABI compat with the 0.8.0 release
Hi,
I see that you've released a new ClanLib, with all my patches (and those from
others) integrated, great! However the changes to
CL_Sprite's constructor means that clanDIsplay-0.8.so.1 is not ABI compatible
with the 0.8.0 release!
The attached patch restores abi compatibility with 0.8.0, esp. interesting for
other Linux distributions which build ClanLib dynamically (and I guess for
windows .dll users too, maybe do a 0.8.2 with this fix?).
Regards,
Hans
p.s.
I've also thrown in a patch fixing one new compile error with gcc-4.3
diff -up ClanLib-0.8.1/Sources/API/Display/sprite.h~ ClanLib-0.8.1/Sources/API/Display/sprite.h
--- ClanLib-0.8.1/Sources/API/Display/sprite.h~ 2008-03-12 22:09:46.000000000 +0100
+++ ClanLib-0.8.1/Sources/API/Display/sprite.h 2008-03-12 22:17:37.000000000 +0100
@@ -86,7 +86,9 @@ public:
const std::string &resource_id,
CL_ResourceManager *manager);
- CL_Sprite(const CL_SpriteDescription &sprite_description, bool pack_texture = true, unsigned int min_width = 16, unsigned int min_height = 16);
+ CL_Sprite(const CL_SpriteDescription &sprite_description, bool pack_texture = true);
+
+ CL_Sprite(const CL_SpriteDescription &sprite_description, bool pack_texture, unsigned int min_width, unsigned int min_height);
CL_Sprite(const CL_Sprite &sprite);
@@ -337,6 +339,8 @@ public:
private:
CL_Sprite_Generic *impl;
+
+ void createFromDescription(const CL_SpriteDescription &spritedescription, bool pack_texture, unsigned int min_width, unsigned int min_height);
};
#endif
diff -up ClanLib-0.8.1/Sources/Display/sprite.cpp~ ClanLib-0.8.1/Sources/Display/sprite.cpp
--- ClanLib-0.8.1/Sources/Display/sprite.cpp~ 2008-03-12 22:17:59.000000000 +0100
+++ ClanLib-0.8.1/Sources/Display/sprite.cpp 2008-03-12 22:17:59.000000000 +0100
@@ -71,9 +71,10 @@ CL_Sprite::CL_Sprite(const std::string &
}
}
-CL_Sprite::CL_Sprite(const CL_SpriteDescription &spritedescription, bool pack_texture, unsigned int min_width, unsigned int min_height)
-: impl(new CL_Sprite_Generic)
+void CL_Sprite::createFromDescription(const CL_SpriteDescription &spritedescription, bool pack_texture, unsigned int min_width, unsigned int min_height)
{
+ impl = new CL_Sprite_Generic;
+
if (pack_texture && CL_DisplayTarget::current()->enable_packer())
{
// Fetch max texture size
@@ -303,6 +304,16 @@ CL_Sprite::CL_Sprite(const CL_SpriteDesc
restart();
}
+CL_Sprite::CL_Sprite(const CL_SpriteDescription &spritedescription, bool pack_texture, unsigned int min_width, unsigned int min_height)
+{
+ createFromDescription(spritedescription, pack_texture, min_width, min_height);
+}
+
+CL_Sprite::CL_Sprite(const CL_SpriteDescription &spritedescription, bool pack_texture)
+{
+ createFromDescription(spritedescription, pack_texture, 16, 16);
+}
+
CL_Sprite::CL_Sprite(const CL_Sprite &sprite)
: impl(0)
{
diff -up ClanLib-0.8.1/Sources/GL/opengl.cpp~ ClanLib-0.8.1/Sources/GL/opengl.cpp
--- ClanLib-0.8.1/Sources/GL/opengl.cpp~ 2008-03-12 10:39:16.000000000 +0100
+++ ClanLib-0.8.1/Sources/GL/opengl.cpp 2008-03-12 10:39:16.000000000 +0100
@@ -33,6 +33,7 @@
#include "API/Core/System/error.h"
#include "API/Core/IOData/cl_endian.h"
#include "API/core.h"
+#include <cstring>
#ifdef __APPLE__
#include <OpenGL/gl.h>
Reply to: