Skip to content

Commit b864469

Browse files
committed
Revert endian_fd dependency changes
1 parent 916bc1a commit b864469

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ default_features = false
3232
default = ["std", "elf32", "elf64", "mach32", "mach64", "pe32", "pe64", "archive", "endian_fd"]
3333
std = ["alloc", "scroll/std"]
3434
alloc = ["scroll/derive", "log"]
35-
endian_fd = ["alloc", "elf32", "elf64", "mach32", "mach64", "pe32", "pe64", "archive"]
35+
endian_fd = ["alloc"]
3636
elf32 = []
3737
elf64 = []
3838
# for now we will require mach and pe to be alloc + endian_fd

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,28 @@ example:
2525
api:
2626
cargo build --no-default-features
2727
cargo build --no-default-features --features="std"
28+
cargo build --no-default-features --features="endian_fd std"
2829
cargo build --no-default-features --features="elf32"
2930
cargo build --no-default-features --features="elf32 elf64"
3031
cargo build --no-default-features --features="elf32 elf64 std"
32+
cargo build --no-default-features --features="elf32 elf64 endian_fd std"
3133
cargo build --no-default-features --features="archive std"
34+
cargo build --no-default-features --features="mach64 std"
35+
cargo build --no-default-features --features="mach32 std"
3236
cargo build --no-default-features --features="mach64 mach32 std"
37+
cargo build --no-default-features --features="pe32 std"
3338
cargo build --no-default-features --features="pe32 pe64 std"
34-
cargo build --no-default-features --features="endian_fd std"
3539
cargo build
3640

3741
nightly_api:
3842
cargo build --no-default-features --features="alloc"
39-
cargo build --no-default-features --features="elf32 elf64 alloc"
43+
cargo build --no-default-features --features="endian_fd"
44+
cargo build --no-default-features --features="elf32 elf64 endian_fd"
4045
cargo build --no-default-features --features="archive"
4146
cargo build --no-default-features --features="mach64"
4247
cargo build --no-default-features --features="mach32"
4348
cargo build --no-default-features --features="mach64 mach32"
4449
cargo build --no-default-features --features="pe32"
4550
cargo build --no-default-features --features="pe32 pe64"
46-
cargo build --no-default-features --features="endian_fd"
4751

4852
.PHONY: clean test example doc

src/elf/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ pub mod dyn;
5252
pub mod reloc;
5353
pub mod note;
5454

55+
macro_rules! if_sylvan {
56+
($($i:item)*) => ($(
57+
#[cfg(all(feature = "elf32", feature = "elf64", feature = "endian_fd"))]
58+
$i
59+
)*)
60+
}
5561

56-
if_endian_fd! {
62+
if_sylvan! {
5763
use scroll::{self, ctx, Pread, Endian};
5864
use strtab::Strtab;
5965
use error;

src/lib.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ macro_rules! if_alloc {
125125
)*)
126126
}
127127

128-
#[allow(unused)]
129-
macro_rules! if_endian_fd {
130-
($($i:item)*) => ($(
131-
#[cfg(feature = "endian_fd")]
132-
$i
133-
)*)
134-
}
135-
136128
#[cfg(feature = "alloc")]
137129
pub mod error;
138130

@@ -222,6 +214,13 @@ pub mod container {
222214
}
223215
}
224216

217+
macro_rules! if_endian_fd {
218+
($($i:item)*) => ($(
219+
#[cfg(all(feature = "endian_fd", feature = "elf64", feature = "elf32", feature = "pe64", feature = "pe32", feature = "mach64", feature = "mach32", feature = "archive"))]
220+
$i
221+
)*)
222+
}
223+
225224
if_endian_fd! {
226225

227226
#[derive(Debug, Default)]

0 commit comments

Comments
 (0)