summaryrefslogtreecommitdiff
path: root/src/pcm
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-27 11:02:58 +0100
committerMax Kellermann <max@musicpd.org>2017-01-27 11:02:58 +0100
commita9316863176f2e66f78b050b772fe87af3462f2c (patch)
tree65aa34c2caa7db13325988a4e10d154b8e25aa7d /src/pcm
parent5bd322bdcf960bc551e05ccc0f934c1031ce6bad (diff)
pcm/SampleFormat: workaround for GCC 4.9 "constexpr" bug
GCC 4.9 has incomplete C++14 support. Specifically, it doesn't allow switch/case in "constexpr" functions.
Diffstat (limited to 'src/pcm')
-rw-r--r--src/pcm/SampleFormat.hxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pcm/SampleFormat.hxx b/src/pcm/SampleFormat.hxx
index 25e6352b6..9ac2c8dab 100644
--- a/src/pcm/SampleFormat.hxx
+++ b/src/pcm/SampleFormat.hxx
@@ -64,7 +64,10 @@ enum class SampleFormat : uint8_t {
/**
* Checks whether the sample format is valid.
*/
-static constexpr inline bool
+#if !GCC_OLDER_THAN(5,0)
+constexpr
+#endif
+static inline bool
audio_valid_sample_format(SampleFormat format)
{
switch (format) {
@@ -83,7 +86,10 @@ audio_valid_sample_format(SampleFormat format)
return false;
}
-static constexpr inline unsigned
+#if !GCC_OLDER_THAN(5,0)
+constexpr
+#endif
+static inline unsigned
sample_format_size(SampleFormat format)
{
switch (format) {