From 0fdec7677c94d6bd89a78006de7dc07d3e60e3b3 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 21 Apr 2019 14:17:13 -0700 Subject: awful tweaks to expose a serde flag on yaxpeax-arch which will trickle through everything --- src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 81ceceb..7ba7a95 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,10 @@ +#[cfg(feature="use-serde")] +#[macro_use] extern crate serde_derive; +#[cfg(feature="use-serde")] +extern crate serde; +#[cfg(feature="use-serde")] +use serde::{Serialize, Deserialize}; + extern crate yaxpeax_arch; extern crate termion; @@ -5,8 +12,14 @@ use yaxpeax_arch::{Arch, Decodable, LengthedInstruction}; mod display; +#[cfg(feature="use-serde")] +#[derive(Debug, Serialize, Deserialize)] +pub struct MSP430; + +#[cfg(not(feature="use-serde"))] #[derive(Debug)] pub struct MSP430; + impl Arch for MSP430 { type Address = u16; type Instruction = Instruction; -- cgit v1.1