Skip to content

Commit 1746792

Browse files
committed
rust: make it compile for aarch64/arm64
1 parent c8f800e commit 1746792

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/rust/bitbox02/src/random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn mcu_32_bytes(out: &mut [u8; 32]) {
1717
unsafe { bitbox02_sys::random_32_bytes_mcu(out.as_mut_ptr()) }
1818
}
1919

20-
#[cfg(target_arch = "x86_64")]
20+
#[cfg(not(target_arch = "arm"))]
2121
pub fn mcu_32_bytes(out: &mut [u8; 32]) {
2222
extern "C" {
2323
fn rand() -> util::c_types::c_int;

src/rust/util/src/c_types.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,22 @@ pub type c_int = i32;
2727

2828
#[cfg(target_arch = "x86_64")]
2929
pub type c_uint = u64;
30+
#[cfg(target_arch = "aarch64")]
31+
pub type c_uint = u64;
3032
#[cfg(target_arch = "arm")]
3133
pub type c_uint = u32;
3234

3335
#[cfg(target_arch = "x86_64")]
3436
pub type c_long = i64;
37+
#[cfg(target_arch = "aarch64")]
38+
pub type c_long = i64;
3539
#[cfg(target_arch = "arm")]
3640
pub type c_long = i32;
3741

3842
#[cfg(target_arch = "x86_64")]
3943
pub type c_ulong = u64;
44+
#[cfg(target_arch = "aarch64")]
45+
pub type c_ulong = u64;
4046
#[cfg(target_arch = "arm")]
4147
pub type c_ulong = u32;
4248

0 commit comments

Comments
 (0)