diff --git a/include/dwarfs/file_type.h b/include/dwarfs/file_type.h index 3864f316..05046ab8 100644 --- a/include/dwarfs/file_type.h +++ b/include/dwarfs/file_type.h @@ -21,6 +21,7 @@ #pragma once +#include #include 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(mode & mask); } };