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.
This commit is contained in:
parent
5bd322bdcf
commit
a931686317
1
NEWS
1
NEWS
@ -1,4 +1,5 @@
|
|||||||
ver 0.20.4 (not yet released)
|
ver 0.20.4 (not yet released)
|
||||||
|
* workaround for GCC 4.9 "constexpr" bug
|
||||||
|
|
||||||
ver 0.20.3 (2017/01/25)
|
ver 0.20.3 (2017/01/25)
|
||||||
* protocol
|
* protocol
|
||||||
|
@ -64,7 +64,10 @@ enum class SampleFormat : uint8_t {
|
|||||||
/**
|
/**
|
||||||
* Checks whether the sample format is valid.
|
* 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)
|
audio_valid_sample_format(SampleFormat format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
@ -83,7 +86,10 @@ audio_valid_sample_format(SampleFormat format)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static constexpr inline unsigned
|
#if !GCC_OLDER_THAN(5,0)
|
||||||
|
constexpr
|
||||||
|
#endif
|
||||||
|
static inline unsigned
|
||||||
sample_format_size(SampleFormat format)
|
sample_format_size(SampleFormat format)
|
||||||
{
|
{
|
||||||
switch (format) {
|
switch (format) {
|
||||||
|
Loading…
Reference in New Issue
Block a user