Squashed 'external/ircolib/' changes from 8cb69c8..cf68f4c

cf68f4c improvements

git-subtree-dir: external/ircolib
git-subtree-split: cf68f4c385c6f2def0e359c3c2a7621ce78062a8
This commit is contained in:
2026-05-18 23:28:07 +02:00
parent 5024d45e58
commit 74b13b4d70
5 changed files with 232 additions and 138 deletions
+25 -1
View File
@@ -10,4 +10,28 @@ using s8 = int8_t;
using s16 = int16_t;
using s32 = int32_t;
using s64 = int64_t;
}
template <typename T, std::size_t bit>
static constexpr bool is_bit_set(const T &val) {
return val & (1 << bit);
}
template <typename T, std::size_t bit>
static constexpr void set_bit(T &val) {
val |= 1 << bit;
}
template <typename T>
inline bool is_bit_set(const T &val, const std::size_t &bit) {
return val & (1 << bit);
}
template <typename T>
inline void set_bit(T &val, const std::size_t &bit) {
val |= 1 << bit;
}
} // namespace ircolib
constexpr ircolib::u32 operator""_kib(const unsigned long long v) { return v * 1024; }
constexpr ircolib::u32 operator""_mib(const unsigned long long v) { return v * 1024 * 1024; }
constexpr ircolib::u32 operator""_gib(const unsigned long long v) { return v * 1024 * 1024 * 1024; }