Fix feature-related compilation issues.

v0.7.x
Dario Nieuwenhuis 2021-03-24 00:49:08 +01:00
parent 99f318f86e
commit a6a28957b3
2 changed files with 18 additions and 4 deletions

View File

@ -32,12 +32,12 @@ url = "1.0"
std = ["managed/std"]
alloc = ["managed/alloc"]
verbose = []
ethernet = []
"phy-raw_socket" = ["std", "libc"]
"phy-tap_interface" = ["std", "libc"]
ethernet = ["socket"]
"phy-raw_socket" = ["std", "libc", "ethernet"]
"phy-tap_interface" = ["std", "libc", "ethernet"]
"proto-ipv4" = []
"proto-igmp" = ["proto-ipv4"]
"proto-dhcpv4" = ["proto-ipv4", "socket-raw"]
"proto-dhcpv4" = ["proto-ipv4", "socket-raw", "ethernet"]
"proto-ipv6" = []
"socket" = []
"socket-raw" = ["socket"]

View File

@ -83,6 +83,20 @@ compile_error!("at least one socket needs to be enabled"); */
#[cfg(feature = "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;
#[macro_use]