Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-fps/blackshades/files/, games-fps/blackshades/
Date: Sun, 02 May 2021 20:46:18
Message-Id: 1619988371.b5b6a3ee5681d326db6247e7e49df2066151ee75.slyfox@gentoo
1 commit: b5b6a3ee5681d326db6247e7e49df2066151ee75
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 2 20:46:00 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun May 2 20:46:11 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5b6a3ee
7
8 games-fps/blackshades: tweak for gcc-11
9
10 Reported-by: Toralf Förster
11 Closes: https://bugs.gentoo.org/787740
12 Package-Manager: Portage-3.0.18, Repoman-3.0.3
13 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
14
15 .../blackshades/blackshades-20070723-r1.ebuild | 1 +
16 .../files/blackshades-20070723-gcc-11.patch | 55 ++++++++++++++++++++++
17 2 files changed, 56 insertions(+)
18
19 diff --git a/games-fps/blackshades/blackshades-20070723-r1.ebuild b/games-fps/blackshades/blackshades-20070723-r1.ebuild
20 index 1ae58711d3a..afd60bab4f0 100644
21 --- a/games-fps/blackshades/blackshades-20070723-r1.ebuild
22 +++ b/games-fps/blackshades/blackshades-20070723-r1.ebuild
23 @@ -27,6 +27,7 @@ RDEPEND="${DEPEND}"
24
25 PATCHES=(
26 "${FILESDIR}"/${PN}-datadir.patch
27 + "${FILESDIR}"/${P}-gcc-11.patch
28 )
29
30 src_prepare() {
31
32 diff --git a/games-fps/blackshades/files/blackshades-20070723-gcc-11.patch b/games-fps/blackshades/files/blackshades-20070723-gcc-11.patch
33 new file mode 100644
34 index 00000000000..5d76ad638cb
35 --- /dev/null
36 +++ b/games-fps/blackshades/files/blackshades-20070723-gcc-11.patch
37 @@ -0,0 +1,55 @@
38 +https://bugs.gentoo.org/787740
39 +--- a/Source/Globals.cpp
40 ++++ b/Source/Globals.cpp
41 +@@ -62,7 +62,7 @@ XYZ n,pa1,pa2,pa3;
42 + float u0, u1, u2;
43 + float v0, v1, v2;
44 + float a, b;
45 +-float max;
46 ++float _max;
47 + int i, j;
48 + bool bInter;
49 + float pointv[3];
50 +--- a/Source/Quaternions.cpp
51 ++++ b/Source/Quaternions.cpp
52 +@@ -316,7 +316,7 @@ float normaldotproduct(XYZ point1, XYZ point2){
53 + extern float u0, u1, u2;
54 + extern float v0, v1, v2;
55 + extern float a, b;
56 +-extern float max;
57 ++extern float _max;
58 + extern int i, j;
59 + extern bool bInter;
60 + extern float pointv[3];
61 +@@ -352,11 +352,11 @@ bool PointInTriangle(Vector *p, Vector normal, float p11, float p12, float p13,
62 +
63 + #define ABS(X) (((X)<0.f)?-(X):(X) )
64 + #define MAX(A, B) (((A)<(B))?(B):(A))
65 +- max = MAX(MAX(ABS(normalv[0]), ABS(normalv[1])), ABS(normalv[2]));
66 ++ _max = MAX(MAX(ABS(normalv[0]), ABS(normalv[1])), ABS(normalv[2]));
67 + #undef MAX
68 +- if (max == ABS(normalv[0])) {i = 1; j = 2;} // y, z
69 +- if (max == ABS(normalv[1])) {i = 0; j = 2;} // x, z
70 +- if (max == ABS(normalv[2])) {i = 0; j = 1;} // x, y
71 ++ if (_max == ABS(normalv[0])) {i = 1; j = 2;} // y, z
72 ++ if (_max == ABS(normalv[1])) {i = 0; j = 2;} // x, z
73 ++ if (_max == ABS(normalv[2])) {i = 0; j = 1;} // x, y
74 + #undef ABS
75 +
76 + u0 = pointv[i] - p1v[i];
77 +@@ -447,11 +447,11 @@ bool PointInTriangle(XYZ *p, XYZ normal, XYZ *p1, XYZ *p2, XYZ *p3)
78 +
79 + #define ABS(X) (((X)<0.f)?-(X):(X) )
80 + #define MAX(A, B) (((A)<(B))?(B):(A))
81 +- max = MAX(MAX(ABS(normalv[0]), ABS(normalv[1])), ABS(normalv[2]));
82 ++ _max = MAX(MAX(ABS(normalv[0]), ABS(normalv[1])), ABS(normalv[2]));
83 + #undef MAX
84 +- if (max == ABS(normalv[0])) {i = 1; j = 2;} // y, z
85 +- if (max == ABS(normalv[1])) {i = 0; j = 2;} // x, z
86 +- if (max == ABS(normalv[2])) {i = 0; j = 1;} // x, y
87 ++ if (_max == ABS(normalv[0])) {i = 1; j = 2;} // y, z
88 ++ if (_max == ABS(normalv[1])) {i = 0; j = 2;} // x, z
89 ++ if (_max == ABS(normalv[2])) {i = 0; j = 1;} // x, y
90 + #undef ABS
91 +
92 + u0 = pointv[i] - p1v[i];