[dolphin-emu] 03/07: Add patch to fix FTBFS with glibc 2.26
James Cowgill
jcowgill at moszumanska.debian.org
Wed Oct 25 22:31:52 UTC 2017
This is an automated email from the git hooks/post-receive script.
jcowgill pushed a commit to branch master
in repository dolphin-emu.
commit 3f7e44a215d8a9227764d96cd61f9880eab9c94b
Author: James Cowgill <jcowgill at debian.org>
Date: Wed Oct 25 20:53:32 2017 +0100
Add patch to fix FTBFS with glibc 2.26
---
debian/patches/02_glibc-2.26.patch | 120 +++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 121 insertions(+)
diff --git a/debian/patches/02_glibc-2.26.patch b/debian/patches/02_glibc-2.26.patch
new file mode 100644
index 0000000..b4ecc05
--- /dev/null
+++ b/debian/patches/02_glibc-2.26.patch
@@ -0,0 +1,120 @@
+Description: Fix FTBFS with glibc 2.26
+ glibc 2.26 defines some new constants in limits.h, one of which is CHAR_WIDTH
+ which conflicts with an internal constant name dolphin-emu uses.
+ .
+ Fix by renaming all the CHAR_* constants to CHARACTER_*.
+Origin: backport, https://github.com/dolphin-emu/dolphin/pull/4496
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/Source/Core/VideoBackends/OGL/RasterFont.cpp
++++ b/Source/Core/VideoBackends/OGL/RasterFont.cpp
+@@ -15,12 +15,12 @@
+ namespace OGL
+ {
+
+-static const int CHAR_WIDTH = 8;
+-static const int CHAR_HEIGHT = 13;
+-static const int CHAR_OFFSET = 32;
+-static const int CHAR_COUNT = 95;
++static const int CHARACTER_WIDTH = 8;
++static const int CHARACTER_HEIGHT = 13;
++static const int CHARACTER_OFFSET = 32;
++static const int CHARACTER_COUNT = 95;
+
+-static const u8 rasters[CHAR_COUNT][CHAR_HEIGHT] = {
++static const u8 rasters[CHARACTER_COUNT][CHARACTER_HEIGHT] = {
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
+ {0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, 0x36, 0x36},
+@@ -146,27 +146,27 @@ RasterFont::RasterFont()
+ glGenTextures(1, &texture);
+ glActiveTexture(GL_TEXTURE8);
+ glBindTexture(GL_TEXTURE_2D, texture);
+- std::vector<u32> texture_data(CHAR_WIDTH * CHAR_COUNT * CHAR_HEIGHT);
+- for (int y = 0; y < CHAR_HEIGHT; y++)
++ std::vector<u32> texture_data(CHARACTER_WIDTH * CHARACTER_COUNT * CHARACTER_HEIGHT);
++ for (int y = 0; y < CHARACTER_HEIGHT; y++)
+ {
+- for (int c = 0; c < CHAR_COUNT; c++)
++ for (int c = 0; c < CHARACTER_COUNT; c++)
+ {
+- for (int x = 0; x < CHAR_WIDTH; x++)
++ for (int x = 0; x < CHARACTER_WIDTH; x++)
+ {
+- bool pixel = (0 != (rasters[c][y] & (1 << (CHAR_WIDTH - x - 1))));
+- texture_data[CHAR_WIDTH * CHAR_COUNT * y + CHAR_WIDTH * c + x] = pixel ? -1 : 0;
++ bool pixel = (0 != (rasters[c][y] & (1 << (CHARACTER_WIDTH - x - 1))));
++ texture_data[CHARACTER_WIDTH * CHARACTER_COUNT * y + CHARACTER_WIDTH * c + x] = pixel ? -1 : 0;
+ }
+ }
+ }
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
+- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHAR_WIDTH * CHAR_COUNT, CHAR_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
++ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, CHARACTER_WIDTH * CHARACTER_COUNT, CHARACTER_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture_data.data());
+
+ // generate shader
+ ProgramShaderCache::CompileShader(s_shader, s_vertexShaderSrc, s_fragmentShaderSrc);
+ s_shader.Bind();
+
+ // bound uniforms
+- glUniform2f(glGetUniformLocation(s_shader.glprogid,"charSize"), 1.0f / GLfloat(CHAR_COUNT), 1.0f);
++ glUniform2f(glGetUniformLocation(s_shader.glprogid,"charSize"), 1.0f / GLfloat(CHARACTER_COUNT), 1.0f);
+ uniform_color_id = glGetUniformLocation(s_shader.glprogid,"color");
+ glUniform4f(uniform_color_id, 1.0f, 1.0f, 1.0f, 1.0f);
+ uniform_offset_id = glGetUniformLocation(s_shader.glprogid, "offset");
+@@ -196,8 +196,8 @@ void RasterFont::printMultilineText(cons
+ std::vector<GLfloat> vertices(text.length() * 6 * 4);
+
+ int usage = 0;
+- GLfloat delta_x = GLfloat(2 * CHAR_WIDTH) / GLfloat(bbWidth);
+- GLfloat delta_y = GLfloat(2 * CHAR_HEIGHT) / GLfloat(bbHeight);
++ GLfloat delta_x = GLfloat(2 * CHARACTER_WIDTH) / GLfloat(bbWidth);
++ GLfloat delta_y = GLfloat(2 * CHARACTER_HEIGHT) / GLfloat(bbHeight);
+ GLfloat border_x = 2.0f / GLfloat(bbWidth);
+ GLfloat border_y = 4.0f / GLfloat(bbHeight);
+
+@@ -220,37 +220,37 @@ void RasterFont::printMultilineText(cons
+ continue;
+ }
+
+- if (c < CHAR_OFFSET || c >= CHAR_COUNT + CHAR_OFFSET)
++ if (c < CHARACTER_OFFSET || c >= CHARACTER_COUNT + CHARACTER_OFFSET)
+ continue;
+
+ vertices[usage++] = x;
+ vertices[usage++] = y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET);
+ vertices[usage++] = 0.0f;
+
+ vertices[usage++] = x + delta_x;
+ vertices[usage++] = y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET + 1);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET + 1);
+ vertices[usage++] = 0.0f;
+
+ vertices[usage++] = x + delta_x;
+ vertices[usage++] = y + delta_y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET + 1);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET + 1);
+ vertices[usage++] = 1.0f;
+
+ vertices[usage++] = x;
+ vertices[usage++] = y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET);
+ vertices[usage++] = 0.0f;
+
+ vertices[usage++] = x + delta_x;
+ vertices[usage++] = y + delta_y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET + 1);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET + 1);
+ vertices[usage++] = 1.0f;
+
+ vertices[usage++] = x;
+ vertices[usage++] = y + delta_y;
+- vertices[usage++] = GLfloat(c - CHAR_OFFSET);
++ vertices[usage++] = GLfloat(c - CHARACTER_OFFSET);
+ vertices[usage++] = 1.0f;
+
+ x += delta_x + border_x;
diff --git a/debian/patches/series b/debian/patches/series
index 6d2d99d..977b1df 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
01_shared-gtest.patch
+02_glibc-2.26.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/dolphin-emu.git
More information about the Pkg-games-commits
mailing list