From 68ec26ca7a2b04fe9a33164ac088e0251260e337 Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Wed, 19 Jul 2023 12:38:41 +0100 Subject: [PATCH 1/3] Fix FTBFS with g++-13 --- src/server/frontend_xwayland/xwayland_clipboard_source.cpp | 4 +++- tests/unit-tests/input/test_touchspot_controller.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/frontend_xwayland/xwayland_clipboard_source.cpp b/src/server/frontend_xwayland/xwayland_clipboard_source.cpp index 24cb2060aa8..00f8eecdf43 100644 --- a/src/server/frontend_xwayland/xwayland_clipboard_source.cpp +++ b/src/server/frontend_xwayland/xwayland_clipboard_source.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -141,7 +142,8 @@ class mf::XWaylandClipboardSource::DataSender : public md::Dispatchable } else { - data.insert(data.end(), new_data.begin(), new_data.end()); + data.reserve(data.size() + new_data.size()); + std::copy(new_data.begin(), new_data.end(), std::back_inserter(data)); return false; } } diff --git a/tests/unit-tests/input/test_touchspot_controller.cpp b/tests/unit-tests/input/test_touchspot_controller.cpp index 41f0ff53f62..cf7109769d3 100644 --- a/tests/unit-tests/input/test_touchspot_controller.cpp +++ b/tests/unit-tests/input/test_touchspot_controller.cpp @@ -48,7 +48,7 @@ struct MockBufferAllocator : public mtd::StubBufferAllocator { using namespace testing; ON_CALL(*this, supported_pixel_formats()) - .WillByDefault(Return(std::vector{ mir_pixel_format_argb_8888 })); + .WillByDefault(Return(std::initializer_list{ mir_pixel_format_argb_8888 })); ON_CALL(*this, alloc_software_buffer(_, _)) .WillByDefault( Invoke( From 002a2d4ba4a6f255588c19527411b7f6187f0bf9 Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Thu, 20 Jul 2023 16:39:56 +0100 Subject: [PATCH 2/3] Apply the same fix we had for g++12 --- debian/rules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 09f77c1414e..742f6f97478 100755 --- a/debian/rules +++ b/debian/rules @@ -69,8 +69,8 @@ ifeq ($(USER) $(DEB_HOST_ARCH),buildd riscv64) endif endif -# Disable pre-compiled headers on GCC-12 -ifneq ($(shell gcc --version | grep '12.[[:digit:]]\+.[[:digit:]]\+$$'),) +# Disable pre-compiled headers on GCC-12 & 13 +ifneq ($(shell gcc --version | grep -e '12.[[:digit:]]\+.[[:digit:]]\+$$' -e '13.[[:digit:]]\+.[[:digit:]]\+$$'),) COMMON_CONFIGURE_OPTIONS += -DMIR_USE_PRECOMPILED_HEADERS=OFF endif From 3fdad273d22a6bd25365a27da2a97dc90f6cd91b Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Thu, 20 Jul 2023 17:16:22 +0100 Subject: [PATCH 3/3] Simplify as suggested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ Sawicz --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 742f6f97478..39acc425c05 100755 --- a/debian/rules +++ b/debian/rules @@ -70,7 +70,7 @@ ifeq ($(USER) $(DEB_HOST_ARCH),buildd riscv64) endif # Disable pre-compiled headers on GCC-12 & 13 -ifneq ($(shell gcc --version | grep -e '12.[[:digit:]]\+.[[:digit:]]\+$$' -e '13.[[:digit:]]\+.[[:digit:]]\+$$'),) +ifneq ($(shell gcc --version | grep '1[23].[[:digit:]]\+.[[:digit:]]\+$$'),) COMMON_CONFIGURE_OPTIONS += -DMIR_USE_PRECOMPILED_HEADERS=OFF endif