소스 검색

Check that at least one medium is enabled if socket is enabled.

Dario Nieuwenhuis 4 년 전
부모
커밋
6705d9f546
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      src/lib.rs

+ 9 - 0
src/lib.rs

@@ -105,6 +105,15 @@ compile_error!("You must enable at least one of the following features: proto-ip
 ))]
 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");
 
+#[cfg(all(
+    feature = "socket",
+    not(any(
+        feature = "medium-ethernet",
+        feature = "medium-ip",
+    ))
+))]
+compile_error!("If you enable the socket feature, you must enable at least one of the following features: medium-ip, medium-ethernet");
+
 #[cfg(all(feature = "defmt", feature = "log"))]
 compile_error!("You must enable at most one of the following features: defmt, log");