Bug 208491 - benchmarks/iperf: Fix build with libc++ 3.8.0
Summary: benchmarks/iperf: 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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 208158
  Show dependency treegraph
 
Reported: 2016-04-03 20:05 UTC by Dimitry Andric
Modified: 2016-04-08 16:52 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
benchmarks/iperf: don't attempt to redefine bool for C++ (900 bytes, patch)
2016-04-03 20:05 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2016-04-03 20:05:07 UTC
Created attachment 168941 [details]
benchmarks/iperf: don't attempt to redefine bool for C++

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

In file included from delay.cpp:53:
In file included from ../include/Timestamp.hpp:63:
In file included from ../include/headers.h:85:
In file included from /usr/include/c++/v1/math.h:309:
/usr/include/c++/v1/type_traits:647:29: error: redefinition of 'std::__1::__libcpp_is_integral<int>'
template <>          struct __libcpp_is_integral<int>                : public true_type {};
                            ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/type_traits:636:29: note: previous definition is here
template <>          struct __libcpp_is_integral<bool>               : public true_type {};
                            ^

This is because iperf's config.h #defines bool as int, but this is of course only applicable to C sources, not C++.  Fix this by surrounding the redefinition with #ifndef __cplusplus.

[1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_18h30m05s/logs/errors/iperf-2.0.5.log
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-04-08 16:30:09 UTC
A commit references this bug:

Author: sunpoet
Date: Fri Apr  8 16:29:21 UTC 2016
New revision: 412773
URL: https://svnweb.freebsd.org/changeset/ports/412773

Log:
  - Fix build with libc++ 3.8.0

  PR:		208491
  Submitted by:	dim

Changes:
  head/benchmarks/iperf/files/patch-config.h.in
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2016-04-08 16:52:44 UTC
Committed. Thanks!