Bug 208491

Summary: benchmarks/iperf: Fix build with libc++ 3.8.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (sunpoet)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 208158    
Description Flags
benchmarks/iperf: don't attempt to redefine bool for C++ none

Description Dimitry Andric freebsd_committer 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 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

  - Fix build with libc++ 3.8.0

  PR:		208491
  Submitted by:	dim

Comment 2 Po-Chuan Hsieh freebsd_committer 2016-04-08 16:52:44 UTC
Committed. Thanks!