From b15271537fc0cc84723a335e59247a89cdfa3975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 18 Jan 2024 18:02:42 +0100 Subject: [PATCH 1/2] GitHub-CI (macos): Set C++ standard for all configurations. * .github/workflows/make.yaml (macos): Apple Clang 14 on the macOS runners defaults to C++98. Use C++11 on all runners. --- .github/workflows/make.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/make.yaml b/.github/workflows/make.yaml index 0085948257..94f7569a9a 100644 --- a/.github/workflows/make.yaml +++ b/.github/workflows/make.yaml @@ -612,7 +612,7 @@ jobs: - name: test stand-alone executable run: | cd examples/code - PATH="/Users/runner/usr/bin:$PATH" CXX="${CXX} ${{ matrix.cxx-compiler-flags }}" \ + PATH="/Users/runner/usr/bin:$PATH" CXX="${CXX} -std=gnu++11" \ mkoctfile --link-stand-alone embedded.cc -o embedded ./embedded From f98ef8d400eb59d2e0ef81a250a95ccb4c6d1f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=BCtzel?= Date: Thu, 18 Jan 2024 19:28:38 +0100 Subject: [PATCH 2/2] oct-stream.h: Use C++11 compatible code. * libinterp/corefcn/oct-stream.h (base_stream::preferred_output_stream): Avoid using std::make_unique which requires C++14. --- libinterp/corefcn/oct-stream.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libinterp/corefcn/oct-stream.h b/libinterp/corefcn/oct-stream.h index 11156bc33d..99fd773b60 100644 --- a/libinterp/corefcn/oct-stream.h +++ b/libinterp/corefcn/oct-stream.h @@ -129,10 +129,14 @@ base_stream std::ostream *os = output_stream (); if (os && *os) { + // FIXME: Using std::make_unique could simplify the following + // expressions once we require C++14. m_converter - = std::make_unique> - (os->rdbuf (), new convfacet_u8 (m_encoding)); - m_conv_ostream = std::make_unique (m_converter.get ()); + = std::unique_ptr> + (new std::wbuffer_convert + (os->rdbuf (), new convfacet_u8 (m_encoding))); + m_conv_ostream = std::unique_ptr + (new std::ostream (m_converter.get ())); } return (m_conv_ostream ? m_conv_ostream.get () : output_stream ());