Skip to content

Commit

Permalink
Fix building on LLVM libc++ (#3388)
Browse files Browse the repository at this point in the history
This should complete the first part of my journey of running Mir on
[Chimera Linux](https://chimera-linux.org) initially reported on #3383.

Now I'm figuring out this runtime failure of `mir_demo_server`
(https://paste.c-net.org/umtbetmnnvsn) which I cannot reproduce on Arch
with (https://paste.c-net.org/a3azgse7x8en) or without these patches,
further opinions welcome :)
  • Loading branch information
AlanGriffiths authored May 14, 2024
2 parents 63ef89c + 4e3b3f4 commit cf8662e
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions include/common/mir/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "mir/logging/logger.h" // for Severity
#include <string>
#include <cstdarg>
#include <exception>

namespace mir
{
Expand Down
1 change: 1 addition & 0 deletions include/miral/miral/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <memory>
#include <string>
#include <unistd.h>

namespace mir
{
Expand Down
4 changes: 2 additions & 2 deletions include/platform/mir/graphics/display_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ struct DisplayConfigurationOutput
std::string name = "OUT-" + std::to_string(id.as_value());

/// Custom attributes (typically set via the .display configuration file
std::map<std::string const, std::optional<std::string>> custom_attribute = {};
std::map<std::string, std::optional<std::string>> custom_attribute = {};

/** The logical rectangle occupied by the output, based on its position,
current mode and orientation (rotation) */
Expand Down Expand Up @@ -196,7 +196,7 @@ struct UserDisplayConfigurationOutput
mir::optional_value<geometry::Size>& custom_logical_size;
std::string const& name;
/// Custom attributes (typically set by the .display configuration file
std::map<std::string const, std::optional<std::string>>& custom_attribute;
std::map<std::string, std::optional<std::string>>& custom_attribute;

UserDisplayConfigurationOutput(DisplayConfigurationOutput& main);
geometry::Rectangle extents() const;
Expand Down
1 change: 1 addition & 0 deletions include/wayland/mir/wayland/protocol_error.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <stdexcept>
#include <cstdint>
#include <string>

struct wl_resource;
struct wl_client;
Expand Down
2 changes: 1 addition & 1 deletion src/miral/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ auto miral::Output::attribute(std::string const& key) const -> std::optional<std

auto miral::Output::attributes_map() const -> std::map<std::string const, std::optional<std::string>>
{
return self->custom_attribute;
return {self->custom_attribute.begin(), self->custom_attribute.end()};
}

bool miral::operator==(Output::PhysicalSizeMM const& lhs, Output::PhysicalSizeMM const& rhs)
Expand Down
2 changes: 1 addition & 1 deletion src/miral/static_display_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class YamlFileDisplayConfig : public mir::graphics::DisplayConfigurationPolicy
mir::optional_value<float> scale;
mir::optional_value<MirOrientation> orientation;
mir::optional_value<int> group_id;
std::map<std::string const, std::optional<std::string>> custom_attribute;
std::map<std::string, std::optional<std::string>> custom_attribute;
};

using Port2Config = std::map<std::string, Config>;
Expand Down
1 change: 1 addition & 0 deletions src/miral/wayland_extensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <set>
#include <map>
#include <vector>
#include <iterator>

namespace mo = mir::options;

Expand Down
1 change: 1 addition & 0 deletions src/platforms/virtual/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "platform.h"
#include <mir/graphics/display.h>
#include <mutex>

namespace mir
{
Expand Down
1 change: 1 addition & 0 deletions src/server/compositor/multi_monitor_arbiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "mir/graphics/buffer.h"
#include "mir/frontend/event_sink.h"
#include <boost/throw_exception.hpp>
#include <algorithm>

namespace mg = mir::graphics;
namespace mc = mir::compositor;
Expand Down
2 changes: 1 addition & 1 deletion src/server/console/linux_virtual_terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ std::future<std::unique_ptr<mir::Device>> mir::LinuxVirtualTerminal::acquire_dev
{
using namespace boost::iostreams;
char line_buffer[1024];
stream<file_descriptor_source> uevent{fd, file_descriptor_flags::never_close_handle};
stream<file_descriptor_source> uevent{static_cast<int>(fd), file_descriptor_flags::never_close_handle};

while (uevent.getline(line_buffer, sizeof(line_buffer)))
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/console/minimal_console_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ std::future<std::unique_ptr<mir::Device>> mir::MinimalConsoleServices::acquire_d
auto const devnode = [](auto const& fd) {
using namespace boost::iostreams;
char line_buffer[1024];
stream<file_descriptor_source> uevent{fd, file_descriptor_flags::never_close_handle};
stream<file_descriptor_source> uevent{static_cast<int>(fd), file_descriptor_flags::never_close_handle};

while (uevent.getline(line_buffer, sizeof(line_buffer)))
{
Expand Down
2 changes: 1 addition & 1 deletion src/server/frontend_wayland/wayland_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class EventLoopDestroyedHandler
* If work_queue *is* unique that means that ~WaylandExecutor has already
* unregistered the event source, so we should not try to do so again.
*/
if (!me->work_queue.unique())
if (me->work_queue.use_count() != 1)
{
wl_event_source_remove(me->source);
}
Expand Down
1 change: 1 addition & 0 deletions src/server/frontend_xwayland/xwayland_client_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "mir/frontend/session_authorizer.h"
#include "mir/frontend/session_credentials.h"

#include <unistd.h>
#include <sys/stat.h>

namespace mf = mir::frontend;
Expand Down
1 change: 1 addition & 0 deletions src/server/input/cursor_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "mir/scene/null_surface_observer.h"
#include "mir/scene/surface.h"

#include <exception>
#include <mutex>
#include <map>

Expand Down
1 change: 1 addition & 0 deletions src/server/scene/rendering_tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "mir/scene/surface.h"

#include <algorithm>
#include <iterator>
#include <stdexcept>
#include <boost/throw_exception.hpp>

Expand Down

0 comments on commit cf8662e

Please sign in to comment.