Skip to content

Commit

Permalink
Gate AbstractType derive macro behind a derive feature-flag
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed May 24, 2024
1 parent ae2d483 commit 0316264
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ edition = "2021"

[features]
noexports = []
derive = ["binaryninja-derive", "elain"]

[dependencies]
lazy_static = "1.4.0"
log = "0.4"
libc = "0.2"
rayon = { version = "1.8", optional = true }
binaryninjacore-sys = { path = "binaryninjacore-sys" }
binaryninja-derive = { path = "binaryninja-derive" }
elain = "0.3.0"
binaryninja-derive = { path = "binaryninja-derive", optional = true }
# Const-generic alignment gadgetry used by the `AbstractType` derive macro
elain = { version = "0.3.0", optional = true }

[patch.crates-io]
# Patched pdb crate to implement some extra structures
Expand Down
1 change: 1 addition & 0 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ use std::path::PathBuf;
pub use binaryninjacore_sys::BNBranchType as BranchType;
pub use binaryninjacore_sys::BNEndianness as Endianness;
use binaryview::BinaryView;
#[cfg(feature = "derive")]
pub use elain;
use metadata::Metadata;
use metadata::MetadataType;
Expand Down
1 change: 1 addition & 0 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ impl Drop for TypeBuilder {
//////////
// Type

#[cfg(feature = "derive")]
pub use binaryninja_derive::*;
pub trait AbstractType: Sized {
const SIZE: usize = std::mem::size_of::<Self>();
Expand Down

0 comments on commit 0316264

Please sign in to comment.