Skip to content

Commit 07fee02

Browse files
committed
ci: build fixes
1 parent 99cbae8 commit 07fee02

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

examples/lookup.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void lookup_api(libremidi::API api, const libremidi::input_port& searched)
3434
{
3535
// Check inputs.
3636
auto ports = midi.get_input_ports();
37-
auto res = libremidi::find_closest_port(searched, ports);
37+
auto res
38+
= libremidi::find_closest_port(searched, std::span<const libremidi::input_port>(ports));
3839
if (res.found) {
3940
std::cout << "Found: " << *res.port << "\n";
4041
}

examples/utils.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ inline std::ostream& operator<<(std::ostream& s, const libremidi::container_iden
4949
void operator()(libremidi::uuid u) { s << "uuid"; }
5050
void operator()(std::string u) { s << u; }
5151
void operator()(uint64_t u) { s << u; }
52-
void operator()(std::monostate) { }
52+
void operator()(libremidi::monostate) { }
5353
} vis{s};
54-
std::visit(vis, id);
54+
visit(vis, id);
5555
return s;
5656
}
5757

@@ -73,9 +73,9 @@ inline std::ostream& operator<<(std::ostream& s, const libremidi::device_identif
7373
<< std::setfill('0') << std::setw(4) << (res & 0x0000FFFF);
7474
s.flags(f);
7575
}
76-
void operator()(std::monostate) { }
76+
void operator()(libremidi::monostate) { }
7777
} vis{s};
78-
std::visit(vis, id);
78+
visit(vis, id);
7979
return s;
8080
}
8181

include/libremidi/config.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,19 @@ using midi_bytes = std::vector<unsigned char>;
9393
#endif
9494

9595
// Use boost::variant2 if available
96+
#define LIBREMIDI_NO_BOOST_VARIANT2 1
9697
#if __has_include(<boost/variant2.hpp>) && !defined(LIBREMIDI_NO_BOOST_VARIANT2)
9798
#if __has_include(<boost/variant2.hpp>)
9899
#include <boost/variant2.hpp>
100+
#define LIBREMIDI_VARIANT_IS_BOOST_VARIANT2
99101
namespace libremidi_variant_alias = boost::variant2;
100-
#else
101-
#include <variant>
102-
namespace libremidi_variant_alias = std;
103102
#endif
103+
#endif
104+
105+
#if !defined(LIBREMIDI_VARIANT_IS_BOOST_VARIANT2)
106+
#include <variant>
107+
namespace libremidi_variant_alias = std;
108+
#endif
104109

105110
namespace libremidi
106111
{
@@ -134,7 +139,6 @@ using libremidi_variant_alias::in_place_index;
134139
using libremidi_variant_alias::in_place_type;
135140
using libremidi_variant_alias::visit;
136141
}
137-
#endif
138142

139143
#if __has_include(<midi/universal_packet.h>) && defined(LIBREMIDI_USE_NI_MIDI2)
140144
#define LIBREMIDI_NI_MIDI2_COMPAT 1

include/libremidi/types.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <compare>
66
#include <cstdint>
77
#include <string>
8-
#include <variant>
98

109
NAMESPACE_LIBREMIDI
1110
{

0 commit comments

Comments
 (0)