Skip to content

Commit 4796185

Browse files
committed
Fix cpu.inc guard to check for actual CPU symbol
- Change guard from checking __CPU_INC_INCLUDED__ to CPU_ISET_NONE - This properly detects if cpu.mac has already been included - Fixes the 'Symbol already defined' errors for all apple2 targets The issue was that .ifndef __CPU_INC_INCLUDED__ didn't prevent the .macpack cpu from being executed multiple times, since the CPU symbols are defined with = (assignment) not .define. Checking for CPU_ISET_NONE (which is defined by cpu.mac) properly guards against multiple inclusion.
1 parent 14b6f90 commit 4796185

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/inc/cpu.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; Guard to prevent multiple inclusion of cpu macros
2-
.ifndef __CPU_INC_INCLUDED__
3-
.define __CPU_INC_INCLUDED__
2+
; Check if CPU_ISET_NONE is already defined (from cpu.mac)
3+
.ifndef CPU_ISET_NONE
44

55
.macpack cpu
66

0 commit comments

Comments
 (0)