aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-04-21 14:22:57 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commit153e8b77d364893a460a7d779347febae36e5b5a (patch)
treeb25386dffdb746315f0dd1dc46d56662af1004fb /src/lib.rs
parent7a45abbef5a1158e3ab676e666cbe69a2d57e36a (diff)
awful tweaks to expose a serde flag on yaxpeax-arch which will trickle through everything
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index d0dbba3..8057114 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;
@@ -333,9 +340,16 @@ pub struct Instruction {
pub length: u8
}
+#[cfg(feature="use-serde")]
+#[derive(Debug, Serialize, Deserialize)]
+#[allow(non_camel_case_types)]
+pub struct x86_64;
+
+#[cfg(not(feature="use-serde"))]
#[derive(Debug)]
#[allow(non_camel_case_types)]
pub struct x86_64;
+
impl Arch for x86_64 {
type Address = u64;
type Instruction = Instruction;