chore: fix architectures and endianness check (#37)

This commit is contained in:
SF-Zhou 2025-03-02 14:57:09 +08:00 committed by GitHub
parent 69c1aea220
commit d79b7dbea4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,15 @@
#include <memory>
#include <string_view>
#include "folly/Portability.h"
namespace hf3fs {
#if !FOLLY_X64 && !FOLLY_AARCH64
#error "The platform must be 64bit!"
#endif
static_assert(std::endian::native == std::endian::little);
// `Status` imitates `abseil::Status` which contains:
// - code
// - (optional) message
@ -101,7 +108,6 @@ class [[nodiscard]] Status {
private:
static_assert(StatusCode::kOK == 0, "StatusCode::kOK must be 0!");
static_assert(__x86_64__, "The platform must be 64bit!");
static_assert(sizeof(status_code_t) == 2, "The width of status_code_t must be 16b");
static constexpr auto kPtrBits = 48u;