mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Implement INCLUDE_ONCE directive (#1481)
Identify files by (device, inode), not by path, so that symlinks, relative paths, case-insensitive paths, or other edge cases do not result in double includes.
This commit is contained in:
3
test/asm/include-once.asm
Normal file
3
test/asm/include-once.asm
Normal file
@@ -0,0 +1,3 @@
|
||||
INCLUDE_ONCE "include-once.inc"
|
||||
INCLUDE_ONCE "include-once.inc"
|
||||
INCLUDE_ONCE "include-link.inc"
|
||||
1
test/asm/include-once.inc
Normal file
1
test/asm/include-once.inc
Normal file
@@ -0,0 +1 @@
|
||||
DEF HELLO EQU 1
|
||||
@@ -11,9 +11,12 @@ input="$(mktemp)"
|
||||
output="$(mktemp)"
|
||||
errput="$(mktemp)"
|
||||
|
||||
# Create a symbolic link for the `include-once.asm` test case.
|
||||
ln include-once.inc include-link.inc
|
||||
|
||||
# Immediate expansion is the desired behavior.
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -f ${o@Q} ${gb@Q} ${input@Q} ${output@Q} ${errput@Q}" EXIT
|
||||
trap "rm -f ${o@Q} ${gb@Q} ${input@Q} ${output@Q} ${errput@Q} include-link.inc" EXIT
|
||||
|
||||
tests=0
|
||||
failed=0
|
||||
|
||||
Reference in New Issue
Block a user