Author: manx
Date: Sat Jun 8 08:18:38 2024
New Revision: 20952
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20952
Log:
[Fix] Work-around broken GCC 11 libstdc++ constexpr vector support.
Modified:
trunk/OpenMPT/soundlib/Sndfile.h
Modified: trunk/OpenMPT/soundlib/Sndfile.h
==============================================================================
--- trunk/OpenMPT/soundlib/Sndfile.h Sat Jun 8 08:17:43 2024 (r20951)
+++ trunk/OpenMPT/soundlib/Sndfile.h Sat Jun 8 08:18:38 2024 (r20952)
@@ -705,7 +705,11 @@
constexpr SAMPLEINDEX GetNumSamples() const noexcept { return m_nSamples; }
constexpr PATTERNINDEX GetCurrentPattern() const noexcept { return m_PlayState.m_nPattern; }
constexpr ORDERINDEX GetCurrentOrder() const noexcept { return m_PlayState.m_nCurrentOrder; }
+#ifndef MPT_LIBCXX_QUIRK_NO_CONSTEXPR_VECTOR
MPT_CONSTEXPR20_FUN CHANNELINDEX GetNumChannels() const noexcept { return static_cast<CHANNELINDEX>(ChnSettings.size()); }
+#else
+ MPT_FORCEINLINE CHANNELINDEX GetNumChannels() const noexcept { return static_cast<CHANNELINDEX>(ChnSettings.size()); }
+#endif
constexpr bool CanAddMoreSamples(SAMPLEINDEX amount = 1) const noexcept { return (amount < MAX_SAMPLES) && m_nSamples < (MAX_SAMPLES - amount); }
constexpr bool CanAddMoreInstruments(INSTRUMENTINDEX amount = 1) const noexcept { return (amount < MAX_INSTRUMENTS) && m_nInstruments < (MAX_INSTRUMENTS - amount); }
|