mirror of https://github.com/openwrt/packages.git
rtpmidi: fix compilation with GCC14 and fmt10.2
Added two patches. Signed-off-by: Rosen Penev <rosenp@gmail.com>pull/23938/merge
parent
487f3b6374
commit
e238bfa798
|
@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||
|
||||
PKG_NAME:=rtpmidid
|
||||
PKG_VERSION:=23.12
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/davidmoreno/rtpmidid
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
--- a/include/rtpmidid/signal.hpp
|
||||
+++ b/include/rtpmidid/signal.hpp
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
+#include <memory>
|
||||
|
||||
// #define DEBUG0 DEBUG
|
||||
#define DEBUG0(...)
|
||||
@@ -171,4 +172,4 @@ public:
|
||||
}
|
||||
#undef DEBUG0
|
||||
};
|
||||
-} // namespace rtpmidid
|
||||
\ No newline at end of file
|
||||
+} // namespace rtpmidid
|
||||
--- a/lib/mdns_rtpmidi.cpp
|
||||
+++ b/lib/mdns_rtpmidi.cpp
|
||||
@@ -28,6 +28,8 @@
|
||||
#include <avahi-common/error.h>
|
||||
#include <avahi-common/malloc.h>
|
||||
|
||||
+#include <algorithm>
|
||||
+
|
||||
struct AvahiTimeout {
|
||||
rtpmidid::poller_t::timer_t timer_id;
|
||||
void *userdata;
|
||||
--- a/lib/poller.cpp
|
||||
+++ b/lib/poller.cpp
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <sys/epoll.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#include <algorithm>
|
||||
+
|
||||
#include <rtpmidid/exceptions.hpp>
|
||||
#include <rtpmidid/logger.hpp>
|
||||
#include <rtpmidid/poller.hpp>
|
|
@ -0,0 +1,197 @@
|
|||
--- a/include/rtpmidid/iobytes.hpp
|
||||
+++ b/include/rtpmidid/iobytes.hpp
|
||||
@@ -330,7 +330,7 @@ public:
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<rtpmidid::io_bytes_reader> : formatter<std::string_view> {
|
||||
- auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) {
|
||||
+ auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) const {
|
||||
return formatter<std::string_view>::format(
|
||||
fmt::format("[io_bytes_reader {} to {}, at {}, {}B left]",
|
||||
(void *)data.start, (void *)data.end, (void *)data.position,
|
||||
@@ -340,7 +340,7 @@ struct fmt::formatter<rtpmidid::io_bytes
|
||||
};
|
||||
template <>
|
||||
struct fmt::formatter<rtpmidid::io_bytes_writer> : formatter<std::string_view> {
|
||||
- auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) {
|
||||
+ auto format(const rtpmidid::io_bytes_reader &data, format_context &ctx) const {
|
||||
return formatter<std::string_view>::format(
|
||||
fmt::format("[io_bytes_writer {} to {}, at {}, {}B left]",
|
||||
(void *)data.start, (void *)data.end, (void *)data.position,
|
||||
--- a/include/rtpmidid/network.hpp
|
||||
+++ b/include/rtpmidid/network.hpp
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<sockaddr_storage> : formatter<std::string_view> {
|
||||
- auto format(const sockaddr_storage &addr, format_context &ctx) {
|
||||
+ auto format(const sockaddr_storage &addr, format_context &ctx) const {
|
||||
// print ip address and port
|
||||
char name[INET6_ADDRSTRLEN];
|
||||
if (addr.ss_family == AF_INET) {
|
||||
--- a/include/rtpmidid/rtpclient.hpp
|
||||
+++ b/include/rtpmidid/rtpclient.hpp
|
||||
@@ -99,7 +99,7 @@ template <>
|
||||
struct fmt::formatter<rtpmidid::rtpclient_t::endpoint_t>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const rtpmidid::rtpclient_t::endpoint_t &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
return formatter<std::string_view>::format(
|
||||
fmt::format("[endpoint_t [{}]:{}]", data.hostname, data.port), ctx);
|
||||
}
|
||||
@@ -109,7 +109,7 @@ template <>
|
||||
struct fmt::formatter<std::vector<rtpmidid::rtpclient_t::endpoint_t>>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const std::vector<rtpmidid::rtpclient_t::endpoint_t> &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
std::string result;
|
||||
for (auto &endpoint : data) {
|
||||
result +=
|
||||
@@ -123,7 +123,7 @@ template <>
|
||||
struct fmt::formatter<std::list<rtpmidid::rtpclient_t::endpoint_t>>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const std::list<rtpmidid::rtpclient_t::endpoint_t> &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
std::string result = "[";
|
||||
for (auto &endpoint : data) {
|
||||
result += fmt::format("[endpoint_t [{}]:{}] ", endpoint.hostname,
|
||||
--- a/include/rtpmidid/rtppeer.hpp
|
||||
+++ b/include/rtpmidid/rtppeer.hpp
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
template <>
|
||||
struct fmt::formatter<rtpmidid::rtppeer_t::status_e>
|
||||
: formatter<std::string_view> {
|
||||
- auto format(rtpmidid::rtppeer_t::status_e c, format_context &ctx) {
|
||||
+ auto format(rtpmidid::rtppeer_t::status_e c, format_context &ctx) const {
|
||||
std::string_view name = "UNKNOWN";
|
||||
switch (c) {
|
||||
case rtpmidid::rtppeer_t::status_e::NOT_CONNECTED:
|
||||
@@ -175,7 +175,7 @@ struct fmt::formatter<rtpmidid::rtppeer_
|
||||
template <>
|
||||
struct fmt::formatter<rtpmidid::rtppeer_t::port_e>
|
||||
: formatter<std::string_view> {
|
||||
- auto format(rtpmidid::rtppeer_t::port_e c, format_context &ctx) {
|
||||
+ auto format(rtpmidid::rtppeer_t::port_e c, format_context &ctx) const {
|
||||
const char *name = "UNKNOWN"; // NOLINT
|
||||
switch (c) {
|
||||
case rtpmidid::rtppeer_t::port_e::MIDI_PORT:
|
||||
@@ -192,7 +192,7 @@ struct fmt::formatter<rtpmidid::rtppeer_
|
||||
template <>
|
||||
struct fmt::formatter<rtpmidid::rtppeer_t::disconnect_reason_e>
|
||||
: formatter<std::string_view> {
|
||||
- auto format(rtpmidid::rtppeer_t::disconnect_reason_e c, format_context &ctx) {
|
||||
+ auto format(rtpmidid::rtppeer_t::disconnect_reason_e c, format_context &ctx) const {
|
||||
const char *name = "UNKNOWN"; // NOLINT
|
||||
switch (c) {
|
||||
case rtpmidid::rtppeer_t::disconnect_reason_e::CANT_CONNECT:
|
||||
--- a/lib/mdns_rtpmidi.cpp
|
||||
+++ b/lib/mdns_rtpmidi.cpp
|
||||
@@ -52,12 +52,12 @@ struct AvahiEntryGroup {
|
||||
rtpmidid::mdns_rtpmidi_t *current = nullptr;
|
||||
|
||||
template <> struct fmt::formatter<AvahiWatchEvent> : fmt::formatter<int> {
|
||||
- auto format(AvahiWatchEvent ev, fmt::format_context &ctx) {
|
||||
+ auto format(AvahiWatchEvent ev, fmt::format_context &ctx) const {
|
||||
return fmt::formatter<int>::format((int)ev, ctx);
|
||||
}
|
||||
};
|
||||
template <> struct fmt::formatter<AvahiBrowserEvent> : fmt::formatter<int> {
|
||||
- auto format(AvahiBrowserEvent ev, fmt::format_context &ctx) {
|
||||
+ auto format(AvahiBrowserEvent ev, fmt::format_context &ctx) const {
|
||||
return fmt::formatter<int>::format((int)ev, ctx);
|
||||
}
|
||||
};
|
||||
--- a/src/aseq.hpp
|
||||
+++ b/src/aseq.hpp
|
||||
@@ -152,7 +152,7 @@ template <> struct hash<rtpmididns::aseq
|
||||
template <>
|
||||
struct fmt::formatter<rtpmididns::aseq_t::port_t>
|
||||
: formatter<std::string_view> {
|
||||
- auto format(rtpmididns::aseq_t::port_t c, format_context &ctx) {
|
||||
+ auto format(rtpmididns::aseq_t::port_t c, format_context &ctx) const {
|
||||
auto name = fmt::format("port_t[{}, {}]", c.client, c.port);
|
||||
return formatter<std::string_view>::format(name, ctx);
|
||||
}
|
||||
--- a/src/mididata.hpp
|
||||
+++ b/src/mididata.hpp
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<rtpmididns::mididata_t> : formatter<std::string_view> {
|
||||
- auto format(const rtpmididns::mididata_t &data, format_context &ctx) {
|
||||
+ auto format(const rtpmididns::mididata_t &data, format_context &ctx) const {
|
||||
|
||||
return fmt::format_to(ctx.out(), "[mididata_t {} + {}, at {}]",
|
||||
(void *)data.start, data.size(), data.pos());
|
||||
}
|
||||
-};
|
||||
\ No newline at end of file
|
||||
+};
|
||||
--- a/src/settings.hpp
|
||||
+++ b/src/settings.hpp
|
||||
@@ -58,7 +58,7 @@ template <>
|
||||
struct fmt::formatter<rtpmididns::settings_t::alsa_announce_t>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const rtpmididns::settings_t::alsa_announce_t &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
|
||||
return fmt::format_to(ctx.out(), "[alsa_announce_t {}]", data.name);
|
||||
}
|
||||
@@ -68,7 +68,7 @@ template <>
|
||||
struct fmt::formatter<std::vector<rtpmididns::settings_t::alsa_announce_t>>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const std::vector<rtpmididns::settings_t::alsa_announce_t> &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
std::string result = "[";
|
||||
for (auto &item : data) {
|
||||
result += fmt::format("[{}] ", item.name);
|
||||
@@ -82,7 +82,7 @@ template <>
|
||||
struct fmt::formatter<rtpmididns::settings_t::rtpmidi_announce_t>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const rtpmididns::settings_t::rtpmidi_announce_t &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
|
||||
return fmt::format_to(ctx.out(), "[rtpmidi_announce_t {} {}]", data.name,
|
||||
data.port);
|
||||
@@ -94,7 +94,7 @@ struct fmt::formatter<std::vector<rtpmid
|
||||
: formatter<std::string_view> {
|
||||
auto
|
||||
format(const std::vector<rtpmididns::settings_t::rtpmidi_announce_t> &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
std::string result = "[";
|
||||
for (auto &item : data) {
|
||||
result +=
|
||||
@@ -109,7 +109,7 @@ template <>
|
||||
struct fmt::formatter<rtpmididns::settings_t::connect_to_t>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const rtpmididns::settings_t::connect_to_t &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
|
||||
return fmt::format_to(ctx.out(), "[connect_to_t {} {} {}]", data.hostname,
|
||||
data.port, data.name);
|
||||
@@ -120,7 +120,7 @@ template <>
|
||||
struct fmt::formatter<std::vector<rtpmididns::settings_t::connect_to_t>>
|
||||
: formatter<std::string_view> {
|
||||
auto format(const std::vector<rtpmididns::settings_t::connect_to_t> &data,
|
||||
- format_context &ctx) {
|
||||
+ format_context &ctx) const {
|
||||
std::string result = "[";
|
||||
for (auto &item : data) {
|
||||
result += fmt::format("[connect_to_t {} {} {}] ", item.hostname,
|
||||
@@ -133,7 +133,7 @@ struct fmt::formatter<std::vector<rtpmid
|
||||
|
||||
template <>
|
||||
struct fmt::formatter<rtpmididns::settings_t> : formatter<std::string_view> {
|
||||
- auto format(const rtpmididns::settings_t &data, format_context &ctx) {
|
||||
+ auto format(const rtpmididns::settings_t &data, format_context &ctx) const {
|
||||
|
||||
return fmt::format_to(ctx.out(),
|
||||
"[settings_t alsa_name: {} alsa_network: {} "
|
Loading…
Reference in New Issue