mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-15 15:26:19 -04:00
refactor(file_type): allow types wider than uint16_t
This commit is contained in:
parent
d74789be4f
commit
b6f5df8185
@ -21,6 +21,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <concepts>
|
||||
#include <cstdint>
|
||||
|
||||
namespace dwarfs {
|
||||
@ -38,7 +39,9 @@ struct posix_file_type {
|
||||
fifo = 0010000,
|
||||
};
|
||||
|
||||
static constexpr value from_mode(uint16_t mode) {
|
||||
static constexpr value from_mode(std::unsigned_integral auto mode)
|
||||
requires(sizeof(mode) >= sizeof(uint16_t))
|
||||
{
|
||||
return static_cast<value>(mode & mask);
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user