blob: 119175c624d2bacd951671d868e21719d1ea3334 (
plain)
1 From 73e9e18ea09ffffcaac50237def0d9728a213c02 Mon Sep 17 00:00:00 2001
2 From: Scott Talbert <swt@techie.net>
3 Date: Sat, 20 Feb 2016 00:08:14 -0500
4 Subject: [PATCH] Fix STC compilation with GCC6
5
6 Use std::abs() from <cmath> instead of abs() from <math.h> to avoid problems
7 with ambiguous overloads.
8
9 Closes #17147.
10
11 Closes https://github.com/wxWidgets/wxWidgets/pull/222
12 ---
13 src/stc/scintilla/src/Editor.cxx | 5 +++--
14 1 file changed, 3 insertions(+), 2 deletions(-)
15
16 diff --git a/src/stc/scintilla/src/Editor.cxx b/src/stc/scintilla/src/Editor.cxx
17 index cd72953..2081df2 100644
18 --- a/src/stc/scintilla/src/Editor.cxx
19 +++ b/src/stc/scintilla/src/Editor.cxx
20 @@ -11,6 +11,7 @@
21 #include <ctype.h>
22 #include <assert.h>
23
24 +#include <cmath>
25 #include <string>
26 #include <vector>
27 #include <map>
28 @@ -5841,9 +5842,9 @@ void Editor::GoToLine(int lineNo) {
29 }
30
31 static bool Close(Point pt1, Point pt2) {
32 - if (abs(pt1.x - pt2.x) > 3)
33 + if (std::abs(pt1.x - pt2.x) > 3)
34 return false;
35 - if (abs(pt1.y - pt2.y) > 3)
36 + if (std::abs(pt1.y - pt2.y) > 3)
37 return false;
38 return true;
39 }
|