aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-22 08:51:06 -0700
committerChris Robinson <[email protected]>2020-03-22 08:51:06 -0700
commit9ce182228d8be25130f3f18b2d999a9612fb18f9 (patch)
tree7b45245f55a4e77dd08d6b13faa67916f5caa285 /alc/backends
parent040309b9f402f9629e1a553665ce789bd530dec2 (diff)
Avoid some pre-C++14 workarounds
Diffstat (limited to 'alc/backends')
-rw-r--r--alc/backends/wasapi.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp
index 4addad1d..059ebec6 100644
--- a/alc/backends/wasapi.cpp
+++ b/alc/backends/wasapi.cpp
@@ -101,8 +101,7 @@ inline constexpr ReferenceTime operator "" _reftime(unsigned long long int n) no
#define X7DOT1 (SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT|SPEAKER_SIDE_LEFT|SPEAKER_SIDE_RIGHT)
#define X7DOT1_WIDE (SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT|SPEAKER_FRONT_CENTER|SPEAKER_LOW_FREQUENCY|SPEAKER_BACK_LEFT|SPEAKER_BACK_RIGHT|SPEAKER_FRONT_LEFT_OF_CENTER|SPEAKER_FRONT_RIGHT_OF_CENTER)
-/* TODO: This can't be constexpr in C++11. */
-inline uint32_t MaskFromTopBits(uint32_t b) noexcept
+constexpr inline uint32_t MaskFromTopBits(uint32_t b) noexcept
{
b |= b>>1;
b |= b>>2;
@@ -111,14 +110,14 @@ inline uint32_t MaskFromTopBits(uint32_t b) noexcept
b |= b>>16;
return b;
}
-const uint32_t MonoMask{MaskFromTopBits(MONO)};
-const uint32_t StereoMask{MaskFromTopBits(STEREO)};
-const uint32_t QuadMask{MaskFromTopBits(QUAD)};
-const uint32_t X51Mask{MaskFromTopBits(X5DOT1)};
-const uint32_t X51RearMask{MaskFromTopBits(X5DOT1REAR)};
-const uint32_t X61Mask{MaskFromTopBits(X6DOT1)};
-const uint32_t X71Mask{MaskFromTopBits(X7DOT1)};
-const uint32_t X71WideMask{MaskFromTopBits(X7DOT1_WIDE)};
+constexpr uint32_t MonoMask{MaskFromTopBits(MONO)};
+constexpr uint32_t StereoMask{MaskFromTopBits(STEREO)};
+constexpr uint32_t QuadMask{MaskFromTopBits(QUAD)};
+constexpr uint32_t X51Mask{MaskFromTopBits(X5DOT1)};
+constexpr uint32_t X51RearMask{MaskFromTopBits(X5DOT1REAR)};
+constexpr uint32_t X61Mask{MaskFromTopBits(X6DOT1)};
+constexpr uint32_t X71Mask{MaskFromTopBits(X7DOT1)};
+constexpr uint32_t X71WideMask{MaskFromTopBits(X7DOT1_WIDE)};
#define DEVNAME_HEAD "OpenAL Soft on "