diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/armv7.rs | 9 | ||||
-rw-r--r-- | src/lib.rs | 4 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/armv7.rs b/src/armv7.rs index 5ac7a7c..ab12797 100644 --- a/src/armv7.rs +++ b/src/armv7.rs @@ -1,3 +1,6 @@ +#[cfg(feature="use-serde")] +use serde::{Serialize, Deserialize}; + use std::fmt::{Display, Formatter}; use yaxpeax_arch::{Arch, Colorize, Colored, ColorSettings, Decodable, LengthedInstruction, ShowContextual, YaxColors}; @@ -1190,8 +1193,14 @@ impl Decodable for Instruction { } } +#[cfg(feature="use-serde")] +#[derive(Debug, Serialize, Deserialize)] +pub struct ARMv7; + +#[cfg(not(feature="use-serde"))] #[derive(Debug)] pub struct ARMv7; + impl Arch for ARMv7 { type Address = u32; type Instruction = Instruction; @@ -1,3 +1,7 @@ +#[cfg(feature="use-serde")] +#[macro_use] extern crate serde_derive; +#[cfg(feature="use-serde")] +extern crate serde; extern crate yaxpeax_arch; pub mod armv7; |