git: c035007f958a - main - devel/boost-libs: apply upstream patch for C++17 support
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 18 May 2023 21:37:13 UTC
The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/ports/commit/?id=c035007f958a9fa3c45bb1441a63540be39018ed commit c035007f958a9fa3c45bb1441a63540be39018ed Author: Dimitry Andric <dim@FreeBSD.org> AuthorDate: 2023-05-18 13:10:20 +0000 Commit: Dimitry Andric <dim@FreeBSD.org> CommitDate: 2023-05-18 21:33:57 +0000 devel/boost-libs: apply upstream patch for C++17 support Since clang 16 (and gcc 11) the default C++ standard is now gnu++17. Several ports that use boost/functional.hpp now complain with (for example print/libmspub01): In file included from MSPUBCollector.cpp:17: In file included from /usr/local/include/boost/multi_array.hpp:34: In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32: /usr/local/include/boost/functional.hpp:45:24: error: no member named 'unary_function' in namespace 'std'; did you mean '__unary_function'? using std::unary_function; ~~~~~^~~~~~~~~~~~~~ __unary_function /usr/include/c++/v1/__functional/unary_function.h:46:1: note: '__unary_function' declared here using __unary_function = __unary_function_keep_layout_base<_Arg, _Result>; ^ In file included from MSPUBCollector.cpp:17: In file included from /usr/local/include/boost/multi_array.hpp:34: In file included from /usr/local/include/boost/multi_array/multi_array_ref.hpp:32: /usr/local/include/boost/functional.hpp:46:24: error: no member named 'binary_function' in namespace 'std'; did you mean '__binary_function'? using std::binary_function; ~~~~~^~~~~~~~~~~~~~~ __binary_function /usr/include/c++/v1/__functional/binary_function.h:49:1: note: '__binary_function' declared here using __binary_function = __binary_function_keep_layout_base<_Arg1, _Arg2, _Result>; ^ This is because std::unary_function and std::binary_function were removed from C++17. Upstream boost/functional fixed this in https://github.com/boostorg/functional/commit/6a573e4, so apply that patch until boost 1.83.0 is released with it. PR: 271488 Approved by: fluffy (maintainer) MFH: 2023Q2 --- devel/boost-libs/Makefile | 2 +- devel/boost-libs/files/patch-boost_functional.hpp | 28 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/devel/boost-libs/Makefile b/devel/boost-libs/Makefile index 5ce2aa66d57f..04cf1418b04a 100644 --- a/devel/boost-libs/Makefile +++ b/devel/boost-libs/Makefile @@ -1,5 +1,5 @@ PORTNAME= boost-libs -PORTREVISION?= 0 +PORTREVISION?= 1 COMMENT= Free portable C++ libraries (without Boost.Python) WWW= https://www.boost.org/ diff --git a/devel/boost-libs/files/patch-boost_functional.hpp b/devel/boost-libs/files/patch-boost_functional.hpp new file mode 100644 index 000000000000..81bd33069087 --- /dev/null +++ b/devel/boost-libs/files/patch-boost_functional.hpp @@ -0,0 +1,28 @@ +From 6a573e4b8333ee63ee62ce95558c3667348db233 Mon Sep 17 00:00:00 2001 +From: Glen Fernandes <glen.fernandes@gmail.com> +Date: Mon, 17 Apr 2023 06:59:02 -0400 +Subject: [PATCH] Define unary_function and binary_function unconditionally + +--- boost/functional.hpp.orig 2023-04-10 13:47:33 UTC ++++ boost/functional.hpp +@@ -21,7 +21,6 @@ namespace boost + namespace functional + { + namespace detail { +-#if defined(_HAS_AUTO_PTR_ETC) && !_HAS_AUTO_PTR_ETC + // std::unary_function and std::binary_function were both removed + // in C++17. + +@@ -39,12 +38,6 @@ namespace boost + typedef Arg2 second_argument_type; + typedef Result result_type; + }; +-#else +- // Use the standard objects when we have them. +- +- using std::unary_function; +- using std::binary_function; +-#endif + } + } +