[go: up one dir, main page]

Skip to content

Fix build with gcc5.

On Slackware64-14.2 with gcc-5.5.0 the build fails in two places.

document.cpp: In member function 'virtual void orcus::spreadsheet::document::dump(orcus::dump_format_t, const string&) const':
document.cpp:492:18: error: 'make_unique' is not a member of 'std'
             fs = std::make_unique<std::ofstream>(output.data());
                  ^
document.cpp:492:18: note: suggested alternatives:
In file included from document.cpp:20:0:
../../include/orcus/global.hpp:59:20: note:   'orcus::make_unique'
 std::unique_ptr<T> make_unique(Args&& ...args)
                    ^
In file included from /usr/include/libixion-0.15/ixion/address.hpp:11:0,
                 from ../../include/orcus/spreadsheet/sheet.hpp:15,
                 from document.cpp:10:
/usr/include/libixion-0.15/ixion/global.hpp:101:20: note:   'ixion::make_unique'
 std::unique_ptr<T> make_unique(Args&& ...args)
                    ^
In file included from /usr/include/mdds-1.5/mdds/multi_type_vector_types.hpp:31:0,
                 from /usr/include/mdds-1.5/mdds/multi_type_vector_trait.hpp:31,
                 from /usr/include/libixion-0.15/ixion/column_store_type.hpp:14,
                 from /usr/include/libixion-0.15/ixion/matrix.hpp:12,
                 from document.cpp:24:
/usr/include/mdds-1.5/mdds/global.hpp:105:20: note:   'mdds::make_unique'
 std::unique_ptr<T> make_unique(Args&& ...args)
                    ^
document.cpp:492:48: error: expected primary-expression before '>' token
             fs = std::make_unique<std::ofstream>(output.data());
                                                ^
Makefile:613: recipe for target 'liborcus_spreadsheet_model_0.15_la-document.lo' failed
make[3]: *** [liborcus_spreadsheet_model_0.15_la-document.lo] Error 1
make[3]: Leaving directory '/tmp/orcus/src/spreadsheet'
Makefile:2091: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/orcus/src'
Makefile:1222: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/orcus'
Makefile:1133: recipe for target 'all' failed
make: *** [all] Error 2
cli_global.cpp: In constructor 'orcus::output_stream::output_stream(const boost::program_options::variables_map&)':
cli_global.cpp:43:13: error: 'make_unique' is not a member of 'std'
     m_ofs = std::make_unique<std::ofstream>(output_path.data());
             ^
cli_global.cpp:43:43: error: expected primary-expression before '>' token
     m_ofs = std::make_unique<std::ofstream>(output_path.data());
                                           ^
Makefile:1687: recipe for target 'orcus_json-cli_global.o' failed
make[3]: *** [orcus_json-cli_global.o] Error 1
make[3]: Leaving directory '/tmp/orcus/src'
Makefile:2091: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/orcus/src'
Makefile:1222: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/orcus'
Makefile:1133: recipe for target 'all' failed
make: *** [all] Error 2

With this change the build succeeds. I also tested gcc-9.1.0, clang-8.0.1 and clang-3.8.0. Note that clang-3.8.0 is also affected and still fails during linking due to an unrelated issue.

Please review this to make sure its correct, thanks!

Merge request reports

Loading