Skip to content

Commit

Permalink
games-board/pouetchess: Fix building with GCC-6
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/show_bug.cgi?id=613428
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Closes: gentoo#4278
  • Loading branch information
Peter-Levine authored and SoapGentoo committed Mar 25, 2017
1 parent 25890eb commit b6dce8e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 16 additions & 0 deletions games-board/pouetchess/files/pouetchess-0.2.0-gcc6-cmath.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- pouetchess_src_0.2.0/src/sxmlgui/MathUtils.h.old 2006-05-26 21:22:57.000000000 -0400
+++ pouetchess_src_0.2.0/src/sxmlgui/MathUtils.h 2017-03-21 18:01:15.569181229 -0400
@@ -27,10 +27,13 @@
return (x < min) ? min : (x > max) ? max : x;
}

+// Not used anywhere and conflicts with C++11 std::round(float)
+#if __cplusplus < 201103L
inline int round(float f)
{
return int(f + 0.5f);
}
+#endif

inline float getNextRandom(){
return (float)rand()/(RAND_MAX + 1);
5 changes: 3 additions & 2 deletions games-board/pouetchess/pouetchess-0.2.0-r1.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
Expand Down Expand Up @@ -27,7 +27,8 @@ src_prepare() {
"${FILESDIR}/${P}-sconstruct-sandbox.patch" \
"${FILESDIR}/${P}-nvidia_glext.patch" \
"${FILESDIR}/${P}-segfaults.patch" \
"${FILESDIR}/${P}-gcc43.patch"
"${FILESDIR}/${P}-gcc43.patch" \
"${FILESDIR}/${P}-gcc6-cmath.patch"
# Fix for LibSDL >= 1.2.10 detection
sed -i \
-e "s:sdlver.split('.') >= \['1','2','8'\]:sdlver.split('.') >= [1,2,8]:" \
Expand Down

0 comments on commit b6dce8e

Please sign in to comment.