// Copyright 2022 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PARTITION_ALLOC_REVERSE_BYTES_H_ #define PARTITION_ALLOC_REVERSE_BYTES_H_ // This header defines drop-in constexpr replacements for the // byte-reversing routines that we used from `//base/sys_byteorder.h`. // They will be made moot by C++23's <endian> header or by C++20's // <bit> header. #include <cstdint> #include "partition_alloc/build_config.h" #include "partition_alloc/partition_alloc_config.h" namespace partition_alloc::internal { constexpr uint32_t ReverseFourBytes(uint32_t value) { … } constexpr uint64_t ReverseEightBytes(uint64_t value) { … } constexpr uintptr_t ReverseBytes(uintptr_t value) { … } } // namespace partition_alloc::internal #endif // PARTITION_ALLOC_REVERSE_BYTES_H_