aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-02-03 10:51:37 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-02-03 10:51:37 +0100
commit42eea452eabf2c603e5f50731ba89f08e3dd81bd (patch)
tree42d06a41eb4ad04a3f56a0e8c0292fd70455731d /crates
parent8b38c88ae55a6edf1028a5aa57b93afdbc4001d6 (diff)
downloadtools.nes-42eea452eabf2c603e5f50731ba89f08e3dd81bd.tar.gz
tools.nes-42eea452eabf2c603e5f50731ba89f08e3dd81bd.zip
Add __NASM__ protection on the --prelude output
The __fallthrough__ macro can only be done when using ca65, not nasm, as that's a protected identifier. Hence, wrap the __fallthrough__ macro definition via an .ifndef __NASM__. Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'crates')
-rw-r--r--crates/nasm/src/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/nasm/src/main.rs b/crates/nasm/src/main.rs
index 923f89e..e6c0042 100644
--- a/crates/nasm/src/main.rs
+++ b/crates/nasm/src/main.rs
@@ -51,9 +51,11 @@ fn print_prelude() {
println!(
r#";; The __fallthrough__ special statement allows developers to explicitly tell
;; the assembler that a "fall through" situation does not happen by mistake.
-.macro __fallthrough__ arg
- ;; NOTE: nothing to do :)
-.endmacro"#
+.ifndef __NASM__
+ .macro __fallthrough__ arg
+ ;; NOTE: nothing to do :)
+ .endmacro
+.endif"#
);
std::process::exit(0);