Skip to content

Commit

Permalink
Add optional zerocopy crate derives
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlf committed Sep 10, 2024
1 parent a515d07 commit 7c64d09
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -132,6 +132,7 @@ cargo-args = ["-Zbuild-std=core"]

[dependencies]
rustc-std-workspace-core = { version = "1.0.0", optional = true }
zerocopy_0_8 = { package = "zerocopy", version = "0.8.0-alpha.21", optional = true, features = ["derive"] }

[features]
default = ["std"]
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -28,6 +28,9 @@
#![cfg_attr(feature = "rustc-dep-of-std", no_core)]
#![cfg_attr(libc_const_extern_fn_unstable, feature(const_extern_fn))]

#[cfg(feature = "zerocopy_0_8")]
extern crate zerocopy_0_8 as zerocopy;

#[macro_use]
mod macros;

1 change: 1 addition & 0 deletions src/unix/bsd/apple/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub type boolean_t = ::c_int;

s! {
#[cfg_attr(feature = "zerocopy_0_8", derive(zerocopy_0_8::FromBytes))]
pub struct malloc_zone_t {
__private: [::uintptr_t; 18], // FIXME: needs arm64 auth pointers support
}

0 comments on commit 7c64d09

Please sign in to comment.