Преглед изворни кода

Throw error if architecture is not supported

Gary Guo пре 3 година
родитељ
комит
32ad71301c
2 измењених фајлова са 15 додато и 0 уклоњено
  1. 8 0
      src/arch.rs
  2. 7 0
      src/unwinder/arch/mod.rs

+ 8 - 0
src/arch.rs

@@ -51,3 +51,11 @@ mod aarch64 {
 }
 #[cfg(target_arch = "aarch64")]
 pub use aarch64::*;
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "riscv64",
+    target_arch = "riscv32",
+    target_arch = "aarch64"
+)))]
+compile_error!("Current architecture is not supported");

+ 7 - 0
src/unwinder/arch/mod.rs

@@ -12,3 +12,10 @@ pub use riscv64::*;
 mod aarch64;
 #[cfg(target_arch = "aarch64")]
 pub use aarch64::*;
+
+#[cfg(not(any(
+    target_arch = "x86_64",
+    target_arch = "riscv64",
+    target_arch = "aarch64"
+)))]
+compile_error!("Current architecture is not supported");