mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
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) ^
This commit is contained in:
parent
13bc999173
commit
e1f8443db0
1 changed files with 9 additions and 9 deletions
|
@ -120,6 +120,15 @@ private:
|
||||||
/// A stream wrapper class that allows you to read arbitrary amounts of bits
|
/// A stream wrapper class that allows you to read arbitrary amounts of bits
|
||||||
/// in little-endian order from another stream.
|
/// in little-endian order from another stream.
|
||||||
class LittleEndianInputBitStream : public 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:
|
public:
|
||||||
explicit LittleEndianInputBitStream(MaybeOwned<Stream> stream)
|
explicit LittleEndianInputBitStream(MaybeOwned<Stream> stream)
|
||||||
: m_stream(move(stream))
|
: m_stream(move(stream))
|
||||||
|
@ -214,15 +223,6 @@ public:
|
||||||
private:
|
private:
|
||||||
using BufferType = u64;
|
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
|
ALWAYS_INLINE BufferType lsb_aligned_buffer() const
|
||||||
{
|
{
|
||||||
return m_bit_offset == bit_buffer_size ? 0 : m_bit_buffer >> m_bit_offset;
|
return m_bit_offset == bit_buffer_size ? 0 : m_bit_buffer >> m_bit_offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue