Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ dependencies = [
"miniscript",
"santiago",
"serde",
"simplicity-sys 0.6.0",
"simplicity-sys 0.6.1",
]

[[package]]
Expand All @@ -518,7 +518,7 @@ dependencies = [

[[package]]
name = "simplicity-sys"
version = "0.6.0"
version = "0.6.1"
dependencies = [
"bitcoin_hashes",
"cc",
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ ghost-cell = { version = "0.2.6", default-features = false }
hashes = { package = "bitcoin_hashes", version = "0.14" }
hex = { package = "hex-conservative", version = "0.2.1" }
santiago = "1.3"
simplicity-sys = { version = "0.6.0", path = "./simplicity-sys" }
simplicity-sys = { version = "0.6.1", path = "./simplicity-sys" }
serde = { version = "1.0.103", features = ["derive"], optional = true }

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

[dev-dependencies]
simplicity-sys = { version = "0.6.0", path = "./simplicity-sys", features = [
simplicity-sys = { version = "0.6.1", path = "./simplicity-sys", features = [
"test-utils",
] }

Expand Down
2 changes: 1 addition & 1 deletion simplicity-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "simplicity-sys"
version = "0.6.0"
version = "0.6.1"
license = "CC0-1.0"
homepage = "https://github.com/BlockstreamResearch/rust-simplicity/"
repository = "https://github.com/BlockstreamResearch/rust-simplicity/"
Expand Down
34 changes: 26 additions & 8 deletions simplicity-sys/src/ffi.rs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I am not sure about the

#[cfg(not(target_arch = "wasm32"))]
pub type c_uint_fast64_t = usize;

Because of: https://en.cppreference.com/w/c/types/integer.html

image

As far as I understand on 32-bit platforms like armv7 because we are using the usize this thing could fail

Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,36 @@ pub type c_int = i32;
pub type c_uint = u32;
pub type c_size_t = usize;
pub type c_uint_fast8_t = u8;
#[cfg(all(
any(target_arch = "wasm32", target_arch = "aarch64"),
not(target_os = "windows")
))]
#[cfg(any(target_os = "macos", target_os = "ios"))]
pub type c_uint_fast16_t = u16;
#[cfg(target_os = "windows")]
#[cfg(any(target_os = "windows", target_os = "android"))]
pub type c_uint_fast16_t = u32;
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows")))]
#[cfg(target_arch = "wasm32")]
pub type c_uint_fast16_t = u16;
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "windows",
target_os = "android",
target_arch = "wasm32"
)))]
pub type c_uint_fast16_t = usize;
#[cfg(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows"))]

#[cfg(any(
target_os = "macos",
target_os = "ios",
target_os = "windows",
target_os = "android",
target_arch = "wasm32"
))]
pub type c_uint_fast32_t = u32;
#[cfg(not(any(target_arch = "wasm32", target_arch = "aarch64", target_os = "windows")))]
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "windows",
target_os = "android",
target_arch = "wasm32"
)))]
pub type c_uint_fast32_t = usize;
#[cfg(target_arch = "wasm32")]
pub type c_uint_fast64_t = u64;
Expand Down