aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-25 20:42:30 -0700
committeriximeow <me@iximeow.net>2024-06-25 20:42:30 -0700
commit90f05466987c185bc4c37c8be1c4ebab3b2f548d (patch)
tree554ae8aad0a48110008743672676e2359c109308
parent1b5cc1daf35e60a9f78158b261a443f2fffd2fcc (diff)
fix yaxpeax-arch not building for non-x86 targets when alloc is not enabled
-rw-r--r--CHANGELOG4
-rw-r--r--Makefile7
-rw-r--r--src/display/display_sink.rs5
3 files changed, 12 insertions, 4 deletions
diff --git a/CHANGELOG b/CHANGELOG
index d8fd706..8cde9b8 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -13,6 +13,10 @@ TODO: impls of `fn one` and `fn zero` so downstream users don't have to import n
TODO: 0.4.0 or later:
* remove `mod colors`, crossterm dependency, related feature flags
+## 0.3.2
+
+fix yaxpeax-arch not building for non-x86 targets when alloc is not enabled
+
## 0.3.1
fix InstructionTextSink::write_char to not panic in debug builds
diff --git a/Makefile b/Makefile
index efe5c3f..57c8615 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,9 @@
-test: test-std test-no-std test-serde-no-std test-colors-no-std test-color-new-no-std test-alloc-no-std
+test: build-smoketest test-std test-no-std test-serde-no-std test-colors-no-std test-color-new-no-std test-alloc-no-std
+
+build-smoketest:
+ cargo build
+ cargo build --no-default-features
+ cargo build --no-default-features --target wasm32-wasi
test-std:
cargo test
diff --git a/src/display/display_sink.rs b/src/display/display_sink.rs
index e83f084..9aa3c85 100644
--- a/src/display/display_sink.rs
+++ b/src/display/display_sink.rs
@@ -1,13 +1,12 @@
use core::fmt;
// `imp_x86.rs` has `asm!()` macros, and so is not portable at all.
-#[cfg(feature="alloc")]
-#[cfg(target_arch = "x86_64")]
+#[cfg(all(feature="alloc", target_arch = "x86_64"))]
#[path="./display_sink/imp_x86.rs"]
mod imp;
// for other architectures, fall back on possibly-slower portable functions.
-#[cfg(not(target_arch = "x86_64"))]
+#[cfg(all(feature="alloc", not(target_arch = "x86_64")))]
#[path="./display_sink/imp_generic.rs"]
mod imp;