mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[upstream_utils] Upgrade Sleipnir (#7973)
This commit is contained in:
41
upstream_utils/sleipnir_patches/0003-Use-wpi-byteswap.patch
Normal file
41
upstream_utils/sleipnir_patches/0003-Use-wpi-byteswap.patch
Normal file
@@ -0,0 +1,41 @@
|
||||
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 3/8] Use wpi::byteswap()
|
||||
|
||||
---
|
||||
include/.styleguide | 1 +
|
||||
include/sleipnir/util/spy.hpp | 3 ++-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/.styleguide b/include/.styleguide
|
||||
index 4f4c76204071f90bf49eddb8c2aceb583b5e09ba..03938557c2600a7a1f72c6b93c935602f5acb2b2 100644
|
||||
--- a/include/.styleguide
|
||||
+++ b/include/.styleguide
|
||||
@@ -10,4 +10,5 @@ includeOtherLibs {
|
||||
^Eigen/
|
||||
^fmt/
|
||||
^gch/
|
||||
+ ^wpi/
|
||||
}
|
||||
diff --git a/include/sleipnir/util/spy.hpp b/include/sleipnir/util/spy.hpp
|
||||
index a2f94803e3744cee771669210d1af883160e9896..8cd7d4353aad20153af5cd7a818fa55889d35721 100644
|
||||
--- a/include/sleipnir/util/spy.hpp
|
||||
+++ b/include/sleipnir/util/spy.hpp
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <string_view>
|
||||
|
||||
#include <Eigen/SparseCore>
|
||||
+#include <wpi/bit.h>
|
||||
|
||||
#include "sleipnir/util/symbol_exports.hpp"
|
||||
|
||||
@@ -115,7 +116,7 @@ class SLEIPNIR_DLLEXPORT Spy {
|
||||
*/
|
||||
void write32le(int32_t num) {
|
||||
if constexpr (std::endian::native != std::endian::little) {
|
||||
- num = std::byteswap(num);
|
||||
+ num = wpi::byteswap(num);
|
||||
}
|
||||
m_file.write(reinterpret_cast<char*>(&num), sizeof(num));
|
||||
}
|
||||
Reference in New Issue
Block a user