From 1311447a94e42644e5f506d946fe9ccd28ccafec Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Wed, 13 Jun 2018 09:42:30 +0200 Subject: [PATCH] [build] Include boost/optional/optional_io.hpp in thin-provisioning/emitter.h (#102) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes following build failure with Boost 1.67.0: ``` In file included from /usr/include/boost/optional/optional.hpp:33, from /usr/include/boost/optional.hpp:15, from ./thin-provisioning/emitter.h:23, from contrib/thin_sexp_emitter.cc:2: /usr/include/boost/optional/optional.hpp: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& boost::operator<<(std::basic_ostream<_CharT, _Traits>&, const boost::optional_detail::optional_tag&) [with CharType = char; CharTrait = std::char_traits]’: ./base/indented_stream.h:31:9: required from ‘{anonymous}::indented_stream& {anonymous}::indented_stream::operator<<(const T&) [with T = boost::optional]’ contrib/thin_sexp_emitter.cc:105:29: required from ‘void {anonymous}::sexp_emitter::kv(const char*, const T&) [with T = boost::optional]’ contrib/thin_sexp_emitter.cc:29:21: required from here /usr/include/boost/optional/optional.hpp:1481:3: error: static assertion failed: If you want to output boost::optional, include header BOOST_STATIC_ASSERT_MSG(sizeof(CharType) == 0, "If you want to output boost::optional, include header "); ^~~~~~~~~~~~~~~~~~~~~~~ make: *** [contrib/Makefile:15: contrib/thin_sexp_emitter.o] Error 1 ``` boost/optional/optional_io.hpp exists since at least Boost 1.34.0, so it is safe to include in older versions, too. --- thin-provisioning/emitter.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/thin-provisioning/emitter.h b/thin-provisioning/emitter.h index bb944da..83a0397 100644 --- a/thin-provisioning/emitter.h +++ b/thin-provisioning/emitter.h @@ -21,6 +21,8 @@ #include #include +#include + #include #include