#pragma once #define LIBREMIDI_VERSION "5.4.3" // clang-format off #if !defined(LIBREMIDI_BASE_NAMESPACE) #define LIBREMIDI_BASE_NAMESPACE libremidi #endif #if defined(LIBREMIDI_MODULE_BUILD) #define LIBREMIDI_MODULE_EXPORT export #define LIBREMIDI_MODULE_BEGIN_EXPORT export { #define LIBREMIDI_MODULE_END_EXPORT } #define NAMESPACE_LIBREMIDI export namespace LIBREMIDI_BASE_NAMESPACE #define NAMESPACE_STDX export namespace stdx #define LIBREMIDI_STATIC inline #define LIBREMIDI_STATIC_IMPLEMENTATION inline #define LIBREMIDI_STATIC_INLINE_IMPLEMENTATION inline #define LIBREMIDI_INLINE_IMPLEMENTATION #define LIBREMIDI_ANONYMOUS_NAMESPACE detail #else #define LIBREMIDI_MODULE_EXPORT #define LIBREMIDI_MODULE_BEGIN_EXPORT #define LIBREMIDI_MODULE_END_EXPORT #define NAMESPACE_LIBREMIDI namespace LIBREMIDI_BASE_NAMESPACE #define NAMESPACE_STDX namespace stdx #define LIBREMIDI_STATIC static inline #if defined(LIBREMIDI_HEADER_ONLY) #define LIBREMIDI_STATIC_IMPLEMENTATION static #define LIBREMIDI_STATIC_INLINE_IMPLEMENTATION static inline #define LIBREMIDI_INLINE_IMPLEMENTATION inline #else #define LIBREMIDI_STATIC_IMPLEMENTATION static #define LIBREMIDI_STATIC_INLINE_IMPLEMENTATION static #define LIBREMIDI_INLINE_IMPLEMENTATION #endif #define LIBREMIDI_ANONYMOUS_NAMESPACE #endif // clang-format on #if defined(_MSC_VER) #define NOMINMAX 1 #define WIN32_LEAN_AND_MEAN #endif // Dynamic exports #if defined(LIBREMIDI_EXPORTS) || defined(LIBREMIDI_MODULE_BUILD) #if defined(_MSC_VER) #define LIBREMIDI_EXPORT __declspec(dllexport) #elif defined(__GNUC__) || defined(__clang__) #define LIBREMIDI_EXPORT __attribute__((visibility("default"))) #endif #else #define LIBREMIDI_EXPORT #endif // Boost check to prevent ABI issues #if defined(LIBREMIDI_USE_BOOST) #if !__has_include() #error \ "Boost was used for building libremidi but is not found when using it. Add Boost to your include paths." #endif #if defined(LIBREMIDI_NO_BOOST) #error "Boost was used for building libremidi but LIBREMIDI_NO_BOOST is defined." #endif #endif // Use boost::small_vector if available #if __has_include() && !defined(LIBREMIDI_NO_BOOST) #if LIBREMIDI_SLIM_MESSAGE > 0 #include NAMESPACE_LIBREMIDI { using midi_bytes = boost::container::static_vector; } #else #include NAMESPACE_LIBREMIDI { LIBREMIDI_STATIC constexpr int small_vector_minimum_size = sizeof(boost::container::small_vector); using midi_bytes = boost::container::small_vector; } #endif #else #include NAMESPACE_LIBREMIDI { using midi_bytes = std::vector; } #endif // Use boost::variant2 if available #define LIBREMIDI_NO_BOOST_VARIANT2 1 #if __has_include() && !defined(LIBREMIDI_NO_BOOST_VARIANT2) #include #define LIBREMIDI_VARIANT_IS_BOOST_VARIANT2 namespace libremidi_variant_alias = boost::variant2; #endif #if !defined(LIBREMIDI_VARIANT_IS_BOOST_VARIANT2) #include namespace libremidi_variant_alias = std; #endif namespace libremidi { using monostate = libremidi_variant_alias::monostate; template concept nothrow_move_constructible = std::is_nothrow_move_constructible_v; template using variant = libremidi_variant_alias::variant; template using slow_variant = libremidi_variant_alias::variant; template using variant_element = libremidi_variant_alias::variant_alternative; template using variant_element_t = libremidi_variant_alias::variant_alternative_t; using libremidi_variant_alias::operator==; using libremidi_variant_alias::operator!=; using libremidi_variant_alias::operator<; using libremidi_variant_alias::operator>; using libremidi_variant_alias::operator<=; using libremidi_variant_alias::operator>=; // using boost::variant2::in_place; // using libremidi_variant_alias::in_place; using libremidi_variant_alias::get; using libremidi_variant_alias::get_if; using libremidi_variant_alias::in_place_index; using libremidi_variant_alias::in_place_type; using libremidi_variant_alias::visit; } #if __has_include() && defined(LIBREMIDI_USE_NI_MIDI2) #define LIBREMIDI_NI_MIDI2_COMPAT 1 #endif #if defined(LIBREMIDI_HEADER_ONLY) #define LIBREMIDI_INLINE inline #else #define LIBREMIDI_INLINE #endif #if __cpp_contracts >= 202502L #define LIBREMIDI_PRECONDITION(...) pre(__VA_ARGS__) #else #define LIBREMIDI_PRECONDITION(...) #endif