Fix feature-related compilation issues.
This commit is contained in:
parent
99f318f86e
commit
a6a28957b3
|
@ -32,12 +32,12 @@ url = "1.0"
|
||||||
std = ["managed/std"]
|
std = ["managed/std"]
|
||||||
alloc = ["managed/alloc"]
|
alloc = ["managed/alloc"]
|
||||||
verbose = []
|
verbose = []
|
||||||
ethernet = []
|
ethernet = ["socket"]
|
||||||
"phy-raw_socket" = ["std", "libc"]
|
"phy-raw_socket" = ["std", "libc", "ethernet"]
|
||||||
"phy-tap_interface" = ["std", "libc"]
|
"phy-tap_interface" = ["std", "libc", "ethernet"]
|
||||||
"proto-ipv4" = []
|
"proto-ipv4" = []
|
||||||
"proto-igmp" = ["proto-ipv4"]
|
"proto-igmp" = ["proto-ipv4"]
|
||||||
"proto-dhcpv4" = ["proto-ipv4", "socket-raw"]
|
"proto-dhcpv4" = ["proto-ipv4", "socket-raw", "ethernet"]
|
||||||
"proto-ipv6" = []
|
"proto-ipv6" = []
|
||||||
"socket" = []
|
"socket" = []
|
||||||
"socket-raw" = ["socket"]
|
"socket-raw" = ["socket"]
|
||||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -83,6 +83,20 @@ compile_error!("at least one socket needs to be enabled"); */
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
|
|
||||||
|
#[cfg(not(any(feature = "proto-ipv4", feature = "proto-ipv6")))]
|
||||||
|
compile_error!("You must enable at least one of the following features: proto-ipv4, proto-ipv6");
|
||||||
|
|
||||||
|
#[cfg(all(
|
||||||
|
feature = "socket",
|
||||||
|
not(any(
|
||||||
|
feature = "socket-raw",
|
||||||
|
feature = "socket-udp",
|
||||||
|
feature = "socket-tcp",
|
||||||
|
feature = "socket-icmp",
|
||||||
|
))
|
||||||
|
))]
|
||||||
|
compile_error!("If you enable the socket feature, you must enable at least one of the following features: socket-raw, socket-udp, socket-tcp, socket-icmp");
|
||||||
|
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
|
Loading…
Reference in New Issue