On Tue, Feb 05 2019, David Coppa <[email protected]> wrote:
> On Tue, Feb 5, 2019 at 12:21 AM Christian Weisgerber <[email protected]> 
> wrote:
>>
>> It looks like the libc++ 7.0.1 update on our clang archs has broken
>> devel/boost:
>>
>> In file included from libs/log/src/syslog_backend.cpp:29:
>> In file included from ./boost/asio/buffer.hpp:27:
>> In file included from ./boost/asio/detail/string_view.hpp:23:
>> /usr/include/c++/v1/experimental/string_view:11:2: error: 
>> "<experimental/string_view> has been removed. Use <string_view> instead."
>> #error "<experimental/string_view> has been removed. Use <string_view> 
>> instead."
>>  ^
>
> Hi,

Hi folks,

> Already fixed upstream:
>
> https://github.com/boostorg/asio/commit/43874d5497414c67655d901e48c939ef01337edb

Backporting this commit and the ones it is based upon doesn't look
trivial.

Yesterday I wrote this diff, which still needs to be tested with
ports-gcc+libstdc++ and ports-clang+libstdc++.  The idea is simply to
use <string_view> whenever possible.

Reviews/oks welcome.


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/boost/Makefile,v
retrieving revision 1.80
diff -u -p -r1.80 Makefile
--- Makefile    3 Jan 2019 07:29:58 -0000       1.80
+++ Makefile    5 Feb 2019 12:56:07 -0000
@@ -9,7 +9,7 @@ VERSION=        1.66.0
 DISTNAME=      boost_${VERSION:S/./_/g}
 PKGNAME-main=  boost-${VERSION}
 PKGNAME-md=    boost-md-${VERSION}
-REVISION-main= 2
+REVISION-main= 3
 CATEGORIES=    devel
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=boost/}
 EXTRACT_SUFX=  .tar.bz2
Index: patches/patch-boost_asio_detail_config_hpp
===================================================================
RCS file: patches/patch-boost_asio_detail_config_hpp
diff -N patches/patch-boost_asio_detail_config_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_asio_detail_config_hpp  5 Feb 2019 12:56:07 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+libc++-7 deprecates <experimental/string_view> so use <string_view> if present
+instead.
+
+libestdc++ provides <string_view> starting with gcc-7.1.0:
+  
https://github.com/gcc-mirror/gcc/commit/76d7f2c208a23ceeffb5e9b8ebe3ce9cc91c4870#diff-077b1e7070de8a0ee56e6c5c2c4c0cc5
+
+Index: boost/asio/detail/config.hpp
+--- boost/asio/detail/config.hpp.orig
++++ boost/asio/detail/config.hpp
+@@ -773,7 +773,9 @@
+ # if !defined(BOOST_ASIO_DISABLE_STD_STRING_VIEW)
+ #  if defined(__clang__)
+ #   if (__cplusplus >= 201402)
+-#    if __has_include(<experimental/string_view>)
++#    if __has_include(<string_view>)
++#     define BOOST_ASIO_HAS_STD_STRING_VIEW 1
++#    elif __has_include(<experimental/string_view>)
+ #     define BOOST_ASIO_HAS_STD_STRING_VIEW 1
+ #     define BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW 1
+ #    endif // __has_include(<experimental/string_view>)
Index: patches/patch-boost_asio_detail_string_view_hpp
===================================================================
RCS file: patches/patch-boost_asio_detail_string_view_hpp
diff -N patches/patch-boost_asio_detail_string_view_hpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-boost_asio_detail_string_view_hpp     5 Feb 2019 12:56:07 
-0000
@@ -0,0 +1,43 @@
+$OpenBSD$
+
+libc++-7 deprecates <experimental/string_view> so use <string_view> if present
+instead.
+
+libestdc++ provides <string_view> starting with gcc-7.1.0:
+  
https://github.com/gcc-mirror/gcc/commit/76d7f2c208a23ceeffb5e9b8ebe3ce9cc91c4870#diff-077b1e7070de8a0ee56e6c5c2c4c0cc5
+
+Index: boost/asio/detail/string_view.hpp
+--- boost/asio/detail/string_view.hpp.orig
++++ boost/asio/detail/string_view.hpp
+@@ -19,22 +19,22 @@
+ 
+ #if defined(BOOST_ASIO_HAS_STD_STRING_VIEW)
+ 
+-#if defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+-# include <experimental/string_view>
+-#else // defined(BOOST_ASIO_HAS_EXPERIMENTAL_STRING_VIEW)
++#if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ # include <string_view>
+-#endif // defined(BOOST_ASIO_HAS_EXPERIMENTAL_STRING_VIEW)
++#else // !defined(BOOST_ASIO_HAS_EXPERIMENTAL_STRING_VIEW)
++# include <experimental/string_view>
++#endif // !defined(BOOST_ASIO_HAS_EXPERIMENTAL_STRING_VIEW)
+ 
+ namespace boost {
+ namespace asio {
+ 
+-#if defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+-using std::experimental::basic_string_view;
+-using std::experimental::string_view;
+-#else // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
++#if !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ using std::basic_string_view;
+ using std::string_view;
+-#endif // defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
++#else // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
++using std::experimental::basic_string_view;
++using std::experimental::string_view;
++#endif // !defined(BOOST_ASIO_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+ 
+ } // namespace asio
+ } // namespace boost


-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Attachment: signature.asc
Description: PGP signature

Reply via email to