Workaround a GCC 5 constexpr function bug

This commit is contained in:
Chris Robinson
2020-12-28 03:36:26 -08:00
parent 7fe9d8d20c
commit 15e05fcef8
+5
View File
@@ -230,7 +230,12 @@ constexpr EffectSlotType EffectSlotTypeFromEnum(ALenum type)
case AL_EFFECT_DEDICATED_DIALOGUE: return EffectSlotType::DedicatedDialog; case AL_EFFECT_DEDICATED_DIALOGUE: return EffectSlotType::DedicatedDialog;
case AL_EFFECT_CONVOLUTION_REVERB_SOFT: return EffectSlotType::Convolution; case AL_EFFECT_CONVOLUTION_REVERB_SOFT: return EffectSlotType::Convolution;
} }
/* GCC 5 doesn't like this in a constexpr function. Clang reports itself as
* GCC 4 or 5, so explicitly allow that.
*/
#if !defined(__GNUC__) || (__GNUC__ > 5) || defined(__clang__)
ERR("Unhandled effect enum: 0x%04x\n", type); ERR("Unhandled effect enum: 0x%04x\n", type);
#endif
return EffectSlotType::None; return EffectSlotType::None;
} }