diff options
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerUtil.h')
-rw-r--r-- | compiler-rt/lib/fuzzer/FuzzerUtil.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerUtil.h b/compiler-rt/lib/fuzzer/FuzzerUtil.h index 4ae35838306d..e90be085008e 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtil.h +++ b/compiler-rt/lib/fuzzer/FuzzerUtil.h @@ -106,6 +106,12 @@ inline uint8_t *RoundDownByPage(uint8_t *P) { return reinterpret_cast<uint8_t *>(X); } +#if __BYTE_ORDER == __LITTLE_ENDIAN +template <typename T> T HostToLE(T X) { return X; } +#else +template <typename T> T HostToLE(T X) { return Bswap(X); } +#endif + } // namespace fuzzer #endif // LLVM_FUZZER_UTIL_H |