Skip to content

Commit

Permalink
devel/jujutsu: fix build on big-endian architectures
Browse files Browse the repository at this point in the history
While functions for converting to LE are suffixed _le, functions for converting to BE don't have any suffix:
error[E0599]: no method named `put_i16_be` found for struct `Vec<u8>` in the current scope
   --> /wrkdirs/usr/ports/devel/jujutsu/work/jj-0.19.0/cargo-crates/serde_bser-0.4.0/src/ser/mod.rs:136:22
    |
136 |         self.scratch.put_i16_be(v);
    |                      ^^^^^^^^^^
    |
help: there is a method `put_i16_le` with a similar name
    |
136 |         self.scratch.put_i16_le(v);
    |                      ~~~~~~~~~~

error[E0599]: no method named `put_i32_be` found for struct `Vec<u8>` in the current scope
  • Loading branch information
pkubaj committed Aug 4, 2024
1 parent 092e5a2 commit 0e65022
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
--- cargo-crates/serde_bser-0.4.0/src/ser/mod.rs.orig 2024-07-30 20:40:15 UTC
+++ cargo-crates/serde_bser-0.4.0/src/ser/mod.rs
@@ -133,7 +133,7 @@ where
#[cfg(target_endian = "little")]
self.scratch.put_i16_le(v);
#[cfg(target_endian = "big")]
- self.scratch.put_i16_be(v);
+ self.scratch.put_i16(v);
}

#[inline]
@@ -143,7 +143,7 @@ where
#[cfg(target_endian = "little")]
self.scratch.put_i32_le(v);
#[cfg(target_endian = "big")]
- self.scratch.put_i32_be(v);
+ self.scratch.put_i32(v);
}

#[inline]
@@ -153,7 +153,7 @@ where
#[cfg(target_endian = "little")]
self.scratch.put_i64_le(v);
#[cfg(target_endian = "big")]
- self.scratch.put_i64_be(v);
+ self.scratch.put_i64(v);
}
}

@@ -255,7 +255,7 @@ where
#[cfg(target_endian = "little")]
self.scratch.put_f64_le(v);
#[cfg(target_endian = "big")]
- self.scratch.put_f64_be(v);
+ self.scratch.put_f64(v);
Ok(())
}

0 comments on commit 0e65022

Please sign in to comment.