Fix tests breaking on modern (#3319)

* Fix tests breaking on modern

* modern tests fix - macro and rodata changes

* ld script rodata modern
This commit is contained in:
DizzyEggg 2023-09-19 12:15:03 +02:00 committed by GitHub
parent a073e7bd59
commit 136ea395ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -837,7 +837,8 @@ void SendOut(u32 sourceLine, struct BattlePokemon *, u32 partyIndex);
#define ABILITY_POPUP(battler, ...) QueueAbility(__LINE__, battler, (struct AbilityEventContext) { __VA_ARGS__ })
#define ANIMATION(type, id, ...) QueueAnimation(__LINE__, type, id, (struct AnimationEventContext) { __VA_ARGS__ })
#define HP_BAR(battler, ...) QueueHP(__LINE__, battler, (struct HPEventContext) { APPEND_TRUE(__VA_ARGS__) })
#define MESSAGE(pattern) QueueMessage(__LINE__, (const u8 []) _(pattern))
// Static const is needed to make the modern compiler put the pattern variable in the .rodata section, instead of putting it on stack(which can break the game).
#define MESSAGE(pattern) do {static const u8 msg[] = _(pattern); QueueMessage(__LINE__, msg);} while (0)
#define STATUS_ICON(battler, status) QueueStatus(__LINE__, battler, (struct StatusEventContext) { status })
enum QueueGroupType

View File

@ -84,9 +84,9 @@ SECTIONS {
.rodata :
ALIGN(4)
{
src/*.o(.rodata);
gflib/*.o(.rodata);
data/*.o(.rodata);
src/*.o(.rodata*);
gflib/*.o(.rodata*);
data/*.o(.rodata*);
} =0
song_data :
@ -111,7 +111,7 @@ SECTIONS {
test/*.o(.tests);
__stop_tests = .;
test/*.o(.text);
test/*.o(.rodata);
test/*.o(.rodata*);
} =0
/* DWARF debug sections.

View File

@ -250,4 +250,3 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp. Def boost is lost after using Spit U
EXPECT_MUL_EQ(results[2].dmgSpecialBefore, UQ_4_12(1.0), results[2].dmgSpecialAfter);
}
}