mir_2_15: Fix GCC 14 compat
This commit is contained in:
@@ -0,0 +1,40 @@
|
|||||||
|
From d31d3abb36163b0f0a892898349d6a99aaf50e10 Mon Sep 17 00:00:00 2001
|
||||||
|
From: OPNA2608 <opna2608@protonmail.com>
|
||||||
|
Date: Thu, 26 Dec 2024 23:12:39 +0100
|
||||||
|
Subject: [PATCH] Fix ignored return value of std::lock_guard
|
||||||
|
|
||||||
|
Upstream this seems to have been resolved as part of the big platform API change, so manually rewrote this change into a patch.
|
||||||
|
---
|
||||||
|
src/platforms/wayland/displayclient.cpp | 2 +-
|
||||||
|
src/server/frontend_xwayland/xcb_connection.cpp | 2 +-
|
||||||
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/platforms/wayland/displayclient.cpp b/src/platforms/wayland/displayclient.cpp
|
||||||
|
index 27bdfe5..987be52 100644
|
||||||
|
--- a/src/platforms/wayland/displayclient.cpp
|
||||||
|
+++ b/src/platforms/wayland/displayclient.cpp
|
||||||
|
@@ -563,7 +563,7 @@ void mgw::DisplayClient::on_display_config_changed()
|
||||||
|
|
||||||
|
void mgw::DisplayClient::delete_outputs_to_be_deleted()
|
||||||
|
{
|
||||||
|
- std::lock_guard{outputs_mutex};
|
||||||
|
+ std::lock_guard lock{outputs_mutex};
|
||||||
|
outputs_to_be_deleted.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/src/server/frontend_xwayland/xcb_connection.cpp b/src/server/frontend_xwayland/xcb_connection.cpp
|
||||||
|
index 4f72b98..0be74b0 100644
|
||||||
|
--- a/src/server/frontend_xwayland/xcb_connection.cpp
|
||||||
|
+++ b/src/server/frontend_xwayland/xcb_connection.cpp
|
||||||
|
@@ -207,7 +207,7 @@ void mf::XCBConnection::verify_not_in_error_state() const
|
||||||
|
|
||||||
|
auto mf::XCBConnection::query_name(xcb_atom_t atom) const -> std::string
|
||||||
|
{
|
||||||
|
- std::lock_guard{atom_name_cache_mutex};
|
||||||
|
+ std::lock_guard lock{atom_name_cache_mutex};
|
||||||
|
auto const iter = atom_name_cache.find(atom);
|
||||||
|
|
||||||
|
if (iter == atom_name_cache.end())
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
From ab00b6d09303c17ecc7a2131a95591716e9ad7a1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jonathan Wakely <jwakely@fedoraproject.org>
|
||||||
|
Date: Thu, 26 Dec 2024 23:00:23 +0100
|
||||||
|
Subject: [PATCH] Add missing includes for <algorithm>
|
||||||
|
|
||||||
|
Co-authored-by: OPNA2608 <opna2608@protonmail.com>
|
||||||
|
---
|
||||||
|
src/miral/external_client.cpp | 1 +
|
||||||
|
src/miral/keymap.cpp | 1 +
|
||||||
|
src/platform/graphics/linux_dmabuf.cpp | 1 +
|
||||||
|
src/server/scene/rendering_tracker.cpp | 1 +
|
||||||
|
tests/unit-tests/graphics/test_overlapping_output_grouping.cpp | 1 +
|
||||||
|
5 files changed, 5 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/miral/external_client.cpp b/src/miral/external_client.cpp
|
||||||
|
index 0c3d176..792b962 100644
|
||||||
|
--- a/src/miral/external_client.cpp
|
||||||
|
+++ b/src/miral/external_client.cpp
|
||||||
|
@@ -22,6 +22,7 @@
|
||||||
|
#include <mir/options/option.h>
|
||||||
|
#include <mir/server.h>
|
||||||
|
|
||||||
|
+#include <algorithm>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
|
namespace mo = mir::options;
|
||||||
|
diff --git a/src/miral/keymap.cpp b/src/miral/keymap.cpp
|
||||||
|
index e494a10..010cb75 100644
|
||||||
|
--- a/src/miral/keymap.cpp
|
||||||
|
+++ b/src/miral/keymap.cpp
|
||||||
|
@@ -30,6 +30,7 @@
|
||||||
|
#define MIR_LOG_COMPONENT "miral::Keymap"
|
||||||
|
#include <mir/log.h>
|
||||||
|
|
||||||
|
+#include <algorithm>
|
||||||
|
#include <mutex>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
diff --git a/src/platform/graphics/linux_dmabuf.cpp b/src/platform/graphics/linux_dmabuf.cpp
|
||||||
|
index f5a750f..840c3d0 100644
|
||||||
|
--- a/src/platform/graphics/linux_dmabuf.cpp
|
||||||
|
+++ b/src/platform/graphics/linux_dmabuf.cpp
|
||||||
|
@@ -41,6 +41,7 @@
|
||||||
|
#include <mutex>
|
||||||
|
#include <vector>
|
||||||
|
#include <optional>
|
||||||
|
+#include <algorithm>
|
||||||
|
#include <drm_fourcc.h>
|
||||||
|
#include <wayland-server.h>
|
||||||
|
|
||||||
|
diff --git a/src/server/scene/rendering_tracker.cpp b/src/server/scene/rendering_tracker.cpp
|
||||||
|
index fe4e05e..24393a3 100644
|
||||||
|
--- a/src/server/scene/rendering_tracker.cpp
|
||||||
|
+++ b/src/server/scene/rendering_tracker.cpp
|
||||||
|
@@ -17,6 +17,7 @@
|
||||||
|
#include "rendering_tracker.h"
|
||||||
|
#include "mir/scene/surface.h"
|
||||||
|
|
||||||
|
+#include <algorithm>
|
||||||
|
#include <stdexcept>
|
||||||
|
#include <boost/throw_exception.hpp>
|
||||||
|
|
||||||
|
diff --git a/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp b/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
|
||||||
|
index 4478578..7167ad1 100644
|
||||||
|
--- a/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
|
||||||
|
+++ b/tests/unit-tests/graphics/test_overlapping_output_grouping.cpp
|
||||||
|
@@ -22,6 +22,7 @@
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
+#include <algorithm>
|
||||||
|
|
||||||
|
namespace mg = mir::graphics;
|
||||||
|
namespace geom = mir::geometry;
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
From 2b3fa53f0115d73d1d515f8c839fc481ba5db46d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alan Griffiths <alan@octopull.co.uk>
|
||||||
|
Date: Thu, 26 Dec 2024 23:21:12 +0100
|
||||||
|
Subject: [PATCH] calloc args in right order
|
||||||
|
|
||||||
|
Co-authored-by: OPNA2608 <opna2608@protonmail.com>
|
||||||
|
---
|
||||||
|
examples/client/wayland_client.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/examples/client/wayland_client.c b/examples/client/wayland_client.c
|
||||||
|
index a52b04c..e644a44 100644
|
||||||
|
--- a/examples/client/wayland_client.c
|
||||||
|
+++ b/examples/client/wayland_client.c
|
||||||
|
@@ -375,7 +375,7 @@ int main(int argc, char** argv)
|
||||||
|
|
||||||
|
struct wl_display* display = wl_display_connect(NULL);
|
||||||
|
struct globals* globals;
|
||||||
|
- globals = calloc(sizeof *globals, 1);
|
||||||
|
+ globals = calloc(1, sizeof *globals);
|
||||||
|
|
||||||
|
struct wl_registry* registry = wl_display_get_registry(display);
|
||||||
|
|
||||||
|
@@ -389,7 +389,7 @@ int main(int argc, char** argv)
|
||||||
|
void* pool_data = NULL;
|
||||||
|
struct wl_shm_pool* shm_pool = make_shm_pool(globals->shm, 400 * 400 * 4, &pool_data);
|
||||||
|
|
||||||
|
- struct draw_context* ctx = calloc(sizeof *ctx, 1);
|
||||||
|
+ struct draw_context* ctx = calloc(1, sizeof *ctx);
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
||||||
@@ -28,6 +28,22 @@ in
|
|||||||
url = "https://github.com/canonical/mir/commit/0704026bd06372ea8286a46d8c939286dd8a8c68.patch";
|
url = "https://github.com/canonical/mir/commit/0704026bd06372ea8286a46d8c939286dd8a8c68.patch";
|
||||||
hash = "sha256-k+51piPQandbHdm+ioqpBrb+C7Aqi2kugchAehZ1aiU=";
|
hash = "sha256-k+51piPQandbHdm+ioqpBrb+C7Aqi2kugchAehZ1aiU=";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# Fix ignored return value of std::lock_guard
|
||||||
|
# Remove when version > 2.15.0
|
||||||
|
# Was changed as part of the big platform API change, no individual upstream commit with this fix
|
||||||
|
./1001-mir-2_15-Fix-ignored-return-value-of-std-lock_guard.patch
|
||||||
|
|
||||||
|
# Fix missing includes for methods from algorithm
|
||||||
|
# Remove when version > 2.16.4
|
||||||
|
# https://github.com/canonical/mir/pull/3191 backported to 2.15
|
||||||
|
./1002-mir-2_15-Add-missing-includes-for-algorithm.patch
|
||||||
|
|
||||||
|
# Fix order of calloc arguments
|
||||||
|
# Remove when version > 2.16.4
|
||||||
|
# Partially done in https://github.com/canonical/mir/pull/3192, though one of the calloc was fixed earlier
|
||||||
|
# when some code was moved into that file
|
||||||
|
./1003-mir-2_15-calloc-args-in-right-order.patch
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user