Fix STC compilation with GCC6

Use std::abs() from <cmath> instead of abs() from <math.h> to avoid problems
with ambiguous overloads.

Closes #17147.

Closes https://github.com/wxWidgets/wxWidgets/pull/222
This commit is contained in:
Scott Talbert
2016-02-20 00:08:14 -05:00
committed by Vadim Zeitlin
parent e7d27c91e6
commit 73e9e18ea0

View File

@@ -11,6 +11,7 @@
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>
#include <cmath>
#include <string> #include <string>
#include <vector> #include <vector>
#include <map> #include <map>
@@ -5841,9 +5842,9 @@ void Editor::GoToLine(int lineNo) {
} }
static bool Close(Point pt1, Point pt2) { static bool Close(Point pt1, Point pt2) {
if (abs(pt1.x - pt2.x) > 3) if (std::abs(pt1.x - pt2.x) > 3)
return false; return false;
if (abs(pt1.y - pt2.y) > 3) if (std::abs(pt1.y - pt2.y) > 3)
return false; return false;
return true; return true;
} }