Files
allwpilib/upstream_utils/sleipnir_patches/0003-Use-wpi-byteswap.patch

31 lines
972 B
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Tue, 28 Jan 2025 22:19:14 -0800
Subject: [PATCH 03/10] Use wpi::byteswap()
---
include/sleipnir/util/spy.hpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/sleipnir/util/spy.hpp b/include/sleipnir/util/spy.hpp
index bf0925e282adffa933d2bc3be8b7441fc4d855d3..49dc97ccea736c51e08b752f863661df54171303 100644
--- a/include/sleipnir/util/spy.hpp
+++ b/include/sleipnir/util/spy.hpp
@@ -12,6 +12,7 @@
#include <string_view>
#include <Eigen/SparseCore>
2025-11-07 19:57:55 -05:00
+#include <wpi/util/bit.hpp>
namespace slp {
@@ -106,7 +107,7 @@ class Spy {
/// @param num A 32-bit signed integer.
void write32le(int32_t num) {
if constexpr (std::endian::native != std::endian::little) {
- num = std::byteswap(num);
+ num = wpi::util::byteswap(num);
}
m_file.write(reinterpret_cast<char*>(&num), sizeof(num));
}