aboutsummaryrefslogtreecommitdiff
path: root/accessibility/easystroke
diff options
context:
space:
mode:
authorMatteo Bernardini <ponce@slackbuilds.org>2017-07-26 17:09:46 +0200
committerRobby Workman <rworkman@slackbuilds.org>2021-04-17 23:20:54 -0500
commitba801b7c73433596fcb4dcb94b9b822cfd82bcae (patch)
treead507a5e5e4f57595981eaf9e09a44a9e7e1122a /accessibility/easystroke
parent5d96f59ec9254d24a34c0f48db6465ab0467805f (diff)
accessibility/easystroke: Patched for gcc >= 7.x.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'accessibility/easystroke')
-rw-r--r--accessibility/easystroke/easystroke.SlackBuild1
-rw-r--r--accessibility/easystroke/gcc7-build-fix.patch40
2 files changed, 41 insertions, 0 deletions
diff --git a/accessibility/easystroke/easystroke.SlackBuild b/accessibility/easystroke/easystroke.SlackBuild
index 29b04e812b6c..3e2f2fedcc9b 100644
--- a/accessibility/easystroke/easystroke.SlackBuild
+++ b/accessibility/easystroke/easystroke.SlackBuild
@@ -59,6 +59,7 @@ sed -i 's|-lboost_serialization-mt|-lboost_serialization|' Makefile
# Thanks to ARCH Linux
patch -p1 < $CWD/lambda.patch
+patch -p1 < $CWD/gcc7-build-fix.patch
make CXX="g++ $SLKCFLAGS" CC="gcc -std=c99 $SLKCFLAGS" PREFIX=/usr
diff --git a/accessibility/easystroke/gcc7-build-fix.patch b/accessibility/easystroke/gcc7-build-fix.patch
new file mode 100644
index 000000000000..b66bcb4edf0a
--- /dev/null
+++ b/accessibility/easystroke/gcc7-build-fix.patch
@@ -0,0 +1,40 @@
+From 9e2c32390c5c253aade3bb703e51841748d2c37e Mon Sep 17 00:00:00 2001
+From: Jonathan Wakely <jwakely@redhat.com>
+Date: Sat, 28 Jan 2017 01:26:00 +0000
+Subject: [PATCH] Remove abs(float) function that clashes with std::abs(float)
+
+Depending on which C++ standard library headers have been included there
+might an abs(float) function already declared in the global namespace,
+so the definition in this file conflicts with it. This cause a build
+failure with GCC 7, which conforms more closely to the C++ standard with
+respect to overloads of abs.
+
+Including <cmath> and adding a using-declaration for std::abs ensures
+that the standard std::abs(float) function is available. This solution
+should be portable to all compilers.
+---
+ handler.cc | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/handler.cc b/handler.cc
+index 8830ea2..685b1ff 100644
+--- a/handler.cc
++++ b/handler.cc
+@@ -23,6 +23,8 @@
+ #include <X11/extensions/XTest.h>
+ #include <X11/XKBlib.h>
+ #include <X11/Xproto.h>
++#include <cmath> // std::abs(float)
++using std::abs;
+
+ XState *xstate = nullptr;
+
+@@ -533,8 +535,6 @@ class WaitForPongHandler : public Handler, protected Timeout {
+ virtual Grabber::State grab_mode() { return parent->grab_mode(); }
+ };
+
+-static inline float abs(float x) { return x > 0 ? x : -x; }
+-
+ class AbstractScrollHandler : public Handler {
+ bool have_x, have_y;
+ float last_x, last_y;