app-benchmarks/i7z: Fix building GUI with GCC 5 (Funtoo bug FL-3617)
authorJames Le Cuirot <chewi@gentoo.org>
Thu, 16 Mar 2017 21:47:51 +0000 (21:47 +0000)
committerJames Le Cuirot <chewi@gentoo.org>
Thu, 16 Mar 2017 21:49:00 +0000 (21:49 +0000)
I wasn't able to reproduce this (possibly affects <gcc-5.4?) but
angry_vincent provided the patch and it doesn't hurt to apply it.

Package-Manager: Portage-2.3.4, Repoman-2.3.2

app-benchmarks/i7z/files/gcc5.patch [new file with mode: 0644]
app-benchmarks/i7z/i7z-93_p20131012.ebuild

diff --git a/app-benchmarks/i7z/files/gcc5.patch b/app-benchmarks/i7z/files/gcc5.patch
new file mode 100644 (file)
index 0000000..dd3ed99
--- /dev/null
@@ -0,0 +1,40 @@
+diff -Nuar i7z-5023138d7c35c4667c938b853e5ea89737334e92/GUI/i7z_GUI.cpp 
+i7z-5023138d7c35c4667c938b853e5ea89737334e92-fixed/GUI/i7z_GUI.cpp
+--- i7z-5023138d7c35c4667c938b853e5ea89737334e92/GUI/i7z_GUI.cpp       2013-10-12 20:59:19.000000000 +0000
++++ i7z-5023138d7c35c4667c938b853e5ea89737334e92-fixed/GUI/i7z_GUI.cpp 2017-03-06 18:27:54.825756111 +0000
+@@ -16,7 +16,7 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <time.h>
+-#include <math.h>
++#include <cmath>
+ #include <QApplication>
+ #include <QPushButton>
+@@ -382,7 +382,7 @@
+             //C1_time[i] -= C3_time[i] + C6_time[i];
+                       C1_time[i] = c1_time - (C3_time[i] + C6_time[i]) ;
+-            if (!isnan(c1_time) && !isinf(c1_time)) {
++            if (!std::isnan(c1_time) && !std::isinf(c1_time)) {
+                 if (C1_time[i] <= 0) {
+                     C1_time[i]=0;
+                 }
+@@ -642,13 +642,13 @@
+     for (i = 0; i < (int)numCPUs; i++)
+     {
+-        if ( (mythread->FREQ[i] > Max_Freq_socket0) && (!isnan(mythread->FREQ[i])) &&
+-                (!isinf(mythread->FREQ[i]))  && (socket_list[i] == socket_0.socket_num) ) {
++        if ( (mythread->FREQ[i] > Max_Freq_socket0) && (!std::isnan(mythread->FREQ[i])) &&
++                (!std::isinf(mythread->FREQ[i]))  && (socket_list[i] == socket_0.socket_num) ) {
+             Max_Freq_socket0 = mythread->FREQ[i];
+             num_socket0_cpus++;
+         }
+-        if ( (mythread->FREQ[i] > Max_Freq_socket1) && (!isnan(mythread->FREQ[i])) &&
+-                (!isinf(mythread->FREQ[i]))  && (socket_list[i] == socket_1.socket_num) ) {
++        if ( (mythread->FREQ[i] > Max_Freq_socket1) && (!std::isnan(mythread->FREQ[i])) &&
++                (!std::isinf(mythread->FREQ[i]))  && (socket_list[i] == socket_1.socket_num) ) {
+             Max_Freq_socket1 = mythread->FREQ[i];
+             num_socket1_cpus++;
+         }
index f5ae2dfa5accea3733615aef5bb89f38c83aa1cf..e8ec6d12e9198144981f57738e86d062ea2329d9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -30,6 +30,7 @@ DEPEND="${RDEPEND}"
 PATCHES=(
        "${FILESDIR}"/i7z-0.27.2-ncurses.patch
        "${FILESDIR}"/qt5.patch
+       "${FILESDIR}"/gcc5.patch
 )
 
 S="${WORKDIR}/${PN}-${COMMIT}"