summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-04-21 14:22:35 -0700
committeriximeow <me@iximeow.net>2020-01-12 17:19:51 -0800
commit139effe81d625439946e8ae3c77e329e2b56710d (patch)
tree22d4321b3ca887b8eff4027eb7431c11b9223565 /src
parent8ec7accda32910cec4bedbce29a3b70ad0d27120 (diff)
awful tweaks to expose a serde flag on yaxpeax-arch which will trickle through everything
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index f9137fa..c2c30a3 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;
use yaxpeax_arch::{Arch, Decodable, LengthedInstruction};
@@ -5,7 +12,14 @@ use yaxpeax_arch::{Arch, Decodable, LengthedInstruction};
pub mod consts;
pub mod display;
+#[cfg(feature="use-serde")]
+#[derive(Debug, Serialize, Deserialize)]
+pub struct PIC18;
+
+#[cfg(not(feature="use-serde"))]
+#[derive(Debug)]
pub struct PIC18;
+
impl Arch for PIC18 {
type Address = u32;
type Instruction = Instruction;