Skip to content

Commit

Permalink
wxWidgets-3.0: upstream patch for abs()
Browse files Browse the repository at this point in the history
This upstream patch fixes a build failure with some newer compilers.

Closes: https://trac.macports.org/ticket/53516
See: wxWidgets/wxWidgets#222
  • Loading branch information
mojca committed Feb 9, 2017
1 parent aa6a8cc commit dabbaa7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions graphics/wxWidgets-3.0/Portfile
Expand Up @@ -87,6 +87,7 @@ depends_run port:wxWidgets-common \

patchfiles-append patch-configure.diff \
patch-upstream-src-osx-carbon-fontdlgosx.mm.diff \
patch-upstream-src-stc-scintilla-src-Editor.cxx.diff \
patch-upstream-webkit-proper-types.diff

if {${subport} eq "wxWidgets-3.0-libcxx"} {
Expand Down
@@ -0,0 +1,27 @@
# An upstream patch for abs()
#
# - https://github.com/wxWidgets/wxWidgets/commit/73e9e18ea09ffffcaac50237def0d9728a213c02
# - https://trac.macports.org/ticket/53516
# - https://github.com/wxWidgets/wxWidgets/pull/222
--- src/stc/scintilla/src/Editor.cxx.orig
+++ src/stc/scintilla/src/Editor.cxx
@@ -11,6 +11,7 @@
#include <ctype.h>
#include <assert.h>

+#include <cmath>
#include <string>
#include <vector>
#include <map>
@@ -5841,9 +5842,9 @@ void Editor::GoToLine(int lineNo) {
}

static bool Close(Point pt1, Point pt2) {
- if (abs(pt1.x - pt2.x) > 3)
+ if (std::abs(pt1.x - pt2.x) > 3)
return false;
- if (abs(pt1.y - pt2.y) > 3)
+ if (std::abs(pt1.y - pt2.y) > 3)
return false;
return true;
}

0 comments on commit dabbaa7

Please sign in to comment.