diff options
author | David Robillard <d@drobilla.net> | 2022-08-16 16:44:29 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-08-16 16:44:29 -0400 |
commit | 3e5cf3400273b0e4f8f96a3a87d2b9e57574eeec (patch) | |
tree | cee5b7cd84248dea488653ca874b40dd8b53c06d /src/SignalDirection.hpp | |
parent | 66e0bb76b40311245b9c59e2f3167e4e98027eba (diff) | |
download | patchage-3e5cf3400273b0e4f8f96a3a87d2b9e57574eeec.tar.gz patchage-3e5cf3400273b0e4f8f96a3a87d2b9e57574eeec.tar.bz2 patchage-3e5cf3400273b0e4f8f96a3a87d2b9e57574eeec.zip |
Upgrade to fmt 9.0.0
This library tends to break in annoying ways like this, so pin the major
version to 9 to hopefully avoid these problems in the future.
Diffstat (limited to 'src/SignalDirection.hpp')
-rw-r--r-- | src/SignalDirection.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/SignalDirection.hpp b/src/SignalDirection.hpp index 3d499a4..84c3cc2 100644 --- a/src/SignalDirection.hpp +++ b/src/SignalDirection.hpp @@ -4,6 +4,15 @@ #ifndef PATCHAGE_SIGNALDIRECTION_HPP #define PATCHAGE_SIGNALDIRECTION_HPP +#include "warnings.hpp" + +PATCHAGE_DISABLE_FMT_WARNINGS +#include <fmt/core.h> +#include <fmt/ostream.h> +PATCHAGE_RESTORE_WARNINGS + +#include <ostream> + namespace patchage { enum class SignalDirection { @@ -12,6 +21,24 @@ enum class SignalDirection { duplex, }; +inline std::ostream& +operator<<(std::ostream& os, const SignalDirection direction) +{ + switch (direction) { + case SignalDirection::input: + return os << "input"; + case SignalDirection::output: + return os << "output"; + case SignalDirection::duplex: + return os << "duplex"; + } + + PATCHAGE_UNREACHABLE(); +} + } // namespace patchage +template<> +struct fmt::formatter<patchage::SignalDirection> : fmt::ostream_formatter {}; + #endif // PATCHAGE_SIGNALDIRECTION_HPP |