summaryrefslogtreecommitdiff
path: root/AK
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2023-03-29 09:03:15 +0200
committerTim Flynn <trflynn89@pm.me>2023-03-29 06:28:55 -0400
commite1f8443db049b60a01139317aff0dccdb16b7ef2 (patch)
treea83ec57b1076422724a446d02cf077b24da8c7ff /AK
parent13bc999173b12cf8029ac4b060b3801afcc23c9e (diff)
downloadserenity-e1f8443db049b60a01139317aff0dccdb16b7ef2.zip
AK: Fix build with Xcode 14.2's clang
Else: AK/BitStream.h:218:24: error: inline function '...::lsb_mask<unsigned char>' is not defined [-Werror,-Wundefined-inline] static constexpr T lsb_mask(T bits) ^
Diffstat (limited to 'AK')
-rw-r--r--AK/BitStream.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/AK/BitStream.h b/AK/BitStream.h
index 3c7ef8ba0b..df7bdd1f5f 100644
--- a/AK/BitStream.h
+++ b/AK/BitStream.h
@@ -120,6 +120,15 @@ private:
/// A stream wrapper class that allows you to read arbitrary amounts of bits
/// in little-endian order from another stream.
class LittleEndianInputBitStream : public Stream {
+ template<Unsigned T>
+ static constexpr T lsb_mask(T bits)
+ {
+ constexpr auto max = NumericLimits<T>::max();
+ constexpr auto digits = NumericLimits<T>::digits();
+
+ return bits == 0 ? 0 : max >> (digits - bits);
+ }
+
public:
explicit LittleEndianInputBitStream(MaybeOwned<Stream> stream)
: m_stream(move(stream))
@@ -214,15 +223,6 @@ public:
private:
using BufferType = u64;
- template<Unsigned T>
- static constexpr T lsb_mask(T bits)
- {
- constexpr auto max = NumericLimits<T>::max();
- constexpr auto digits = NumericLimits<T>::digits();
-
- return bits == 0 ? 0 : max >> (digits - bits);
- }
-
ALWAYS_INLINE BufferType lsb_aligned_buffer() const
{
return m_bit_offset == bit_buffer_size ? 0 : m_bit_buffer >> m_bit_offset;