]> git.sesse.net Git - casparcg/commitdiff
Fix compilation with Boost 1.63.0.
authorSteinar H. Gunderson <steinar+casparcg@gunderson.no>
Mon, 1 May 2017 22:16:57 +0000 (00:16 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 May 2017 23:13:53 +0000 (01:13 +0200)
This is Boost bug #12998.

common/log.cpp

index b2269db238bc978f54d81928abe215ef730f42f5..74fa7cd542fddc87e3c6168bb8341a720094dfad 100644 (file)
@@ -212,7 +212,9 @@ std::shared_ptr<void> add_preformatted_line_sink(std::function<void(std::string
        {
                std::function<void(std::string line)> formatted_line_sink_;
        public:
-               sink_backend(std::function<void(std::string line)> formatted_line_sink)
+               // The dummy parameter is to work around a bug in newer Boost.Log, where single-argument
+               // constructor forwarders are not recognized unless the parameter uses Boost.Parameter.
+               sink_backend(std::function<void(std::string line)> formatted_line_sink, int)
                        : formatted_line_sink_(std::move(formatted_line_sink))
                {
                }
@@ -232,7 +234,7 @@ std::shared_ptr<void> add_preformatted_line_sink(std::function<void(std::string
 
        typedef boost::log::sinks::synchronous_sink<sink_backend> sink_type;
 
-       auto sink = boost::make_shared<sink_type>(std::move(formatted_line_sink));
+       auto sink = boost::make_shared<sink_type>(std::move(formatted_line_sink), 0);
        bool print_all_characters = true;
 
        sink->set_formatter(boost::bind(&my_formatter<boost::log::formatting_ostream>, print_all_characters, _1, _2));