Bug 209694 - x11-toolkits/wxgtk30: Fix build with libc++ 3.8.0
Summary: x11-toolkits/wxgtk30: Fix build with libc++ 3.8.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs mailing list
URL:
Keywords: patch
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-05-22 11:46 UTC by Dimitry Andric
Modified: 2016-05-23 16:35 UTC (History)
1 user (show)

See Also:
portmaster: maintainer-feedback+


Attachments
Include <cmath> so abs(float) can be found (944 bytes, patch)
2016-05-22 11:46 UTC, Dimitry Andric
vlad-fbsd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 2016-05-22 11:46:49 UTC
Created attachment 170542 [details]
Include <cmath> so abs(float) can be found

During the exp-run in bug 208158, it was found that x11-toolkits/wxgtk30 gives errors with libc++ 3.8.0 [1]:

./src/stc/scintilla/src/Editor.cxx:5844:6: error: call to 'abs' is ambiguous
        if (abs(pt1.x - pt2.x) > 3)
            ^~~

This is because pt1.x and pt2.x are float values, but <cmath> is not included, and abs() for float values comes from that header.  Fix it by including <cmath>.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-05-01_10h29m48s/logs/errors/wx30-gtk2-3.0.2_4.log
Comment 1 Chris Hutchinson 2016-05-23 04:31:09 UTC
Comment on attachment 170542 [details]
Include <cmath> so abs(float) can be found

Makes sense.
Looks good,  Dimitry.

Thanks!

--Chris
Comment 2 VK freebsd_triage 2016-05-23 07:29:29 UTC
Comment on attachment 170542 [details]
Include <cmath> so abs(float) can be found

Maintainer approved.
Comment 3 commit-hook freebsd_committer 2016-05-23 16:26:22 UTC
A commit references this bug:

Author: dim
Date: Mon May 23 16:25:21 UTC 2016
New revision: 415729
URL: https://svnweb.freebsd.org/changeset/ports/415729

Log:
  During the exp-run in bug 208158, it was found that x11-toolkits/wxgtk30
  gives errors with libc++ 3.8.0:

  ./src/stc/scintilla/src/Editor.cxx:5844:6: error: call to 'abs' is ambiguous
          if (abs(pt1.x - pt2.x) > 3)
              ^~~

  This is because pt1.x and pt2.x are float values, but <cmath> is not
  included, and abs() for float values comes from that header.  Fix it by
  including <cmath>.

  Approved by:	portmaster@bsdforge.com (maintainer)
  Approved by:	vlad-fbsd@acheronmedia.com (maintainer)
  PR:		209694
  MFH:		2016Q2

Changes:
  head/x11-toolkits/wxgtk30/files/patch-src_stc_scintilla_src_Editor.cxx