Skip to content

Commit 7f42b53

Browse files
committed
Merge #334: fix ffi for platform-specific uint_fast types for macOS and Android
7a77539 Bump simplicity-sys version to 0.6.1 (Kyryl R) 4126e2e fix ffi for platform-specific uint_fast types for macOS and Android (Kyryl R) Pull request description: Fixes: - macOS (x86_64 and arm64): uint_fast16_t is u16, not usize - Android (Bionic libc): uint_fast16_t is u32, not u16 - jet FFI calls failing on Intel Mac and Android Because of the previous setup I have encountered failures the one below: Blockstream/gdk#221 ACKs for top commit: apoelstra: ACK 7a77539; successfully ran local tests Tree-SHA512: e37f218916f086af480baf341756c94f27fc59700e38fe99595743bbae1f5d7dd2fc4b8f9734a189f8249ad857666dcd608abc981a1df9d47f5924e94a3bf01a
2 parents a862858 + 7a77539 commit 7f42b53

File tree

4 files changed

+31
-13
lines changed

4 files changed

+31
-13
lines changed

Cargo-recent.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ dependencies = [
503503
"miniscript",
504504
"santiago",
505505
"serde",
506-
"simplicity-sys 0.6.0",
506+
"simplicity-sys 0.6.1",
507507
]
508508

509509
[[package]]
@@ -518,7 +518,7 @@ dependencies = [
518518

519519
[[package]]
520520
name = "simplicity-sys"
521-
version = "0.6.0"
521+
version = "0.6.1"
522522
dependencies = [
523523
"bitcoin_hashes",
524524
"cc",

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ ghost-cell = { version = "0.2.6", default-features = false }
3030
hashes = { package = "bitcoin_hashes", version = "0.14" }
3131
hex = { package = "hex-conservative", version = "0.2.1" }
3232
santiago = "1.3"
33-
simplicity-sys = { version = "0.6.0", path = "./simplicity-sys" }
33+
simplicity-sys = { version = "0.6.1", path = "./simplicity-sys" }
3434
serde = { version = "1.0.103", features = ["derive"], optional = true }
3535

3636
[target.wasm32-unknown-unknown.dependencies]
3737
getrandom = { version = "0.2", features = ["js"] }
3838

3939
[dev-dependencies]
40-
simplicity-sys = { version = "0.6.0", path = "./simplicity-sys", features = [
40+
simplicity-sys = { version = "0.6.1", path = "./simplicity-sys", features = [
4141
"test-utils",
4242
] }
4343

simplicity-sys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "simplicity-sys"
3-
version = "0.6.0"
3+
version = "0.6.1"
44
license = "CC0-1.0"
55
homepage = "https://github.com/BlockstreamResearch/rust-simplicity/"
66
repository = "https://github.com/BlockstreamResearch/rust-simplicity/"

simplicity-sys/src/ffi.rs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,36 @@ pub type c_int = i32;
1919
pub type c_uint = u32;
2020
pub type c_size_t = usize;
2121
pub type c_uint_fast8_t = u8;
22-
#[cfg(all(
23-
any(target_arch = "wasm32", target_arch = "aarch64"),
24-
not(target_os = "windows")
25-
))]
22+
#[cfg(any(target_os = "macos", target_os = "ios"))]
2623
pub type c_uint_fast16_t = u16;
27-
#[cfg(target_os = "windows")]
24+
#[cfg(any(target_os = "windows", target_os = "android"))]
2825
pub type c_uint_fast16_t = u32;
29-
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows")))]
26+
#[cfg(target_arch = "wasm32")]
27+
pub type c_uint_fast16_t = u16;
28+
#[cfg(not(any(
29+
target_os = "macos",
30+
target_os = "ios",
31+
target_os = "windows",
32+
target_os = "android",
33+
target_arch = "wasm32"
34+
)))]
3035
pub type c_uint_fast16_t = usize;
31-
#[cfg(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows"))]
36+
37+
#[cfg(any(
38+
target_os = "macos",
39+
target_os = "ios",
40+
target_os = "windows",
41+
target_os = "android",
42+
target_arch = "wasm32"
43+
))]
3244
pub type c_uint_fast32_t = u32;
33-
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows")))]
45+
#[cfg(not(any(
46+
target_os = "macos",
47+
target_os = "ios",
48+
target_os = "windows",
49+
target_os = "android",
50+
target_arch = "wasm32"
51+
)))]
3452
pub type c_uint_fast32_t = usize;
3553
#[cfg(target_arch = "wasm32")]
3654
pub type c_uint_fast64_t = u64;

0 commit comments

Comments
 (0)