libdebugger/rtems-debugger-arm.c: Fix using defined() in expansion

The definition of NEEDS_THUMB_SWITCH was not portable and flagged by
the GCC -Wexpansion-to-defined. It is not portable to expand a macro
which uses futher cpp directives.

Closes #5328.
This commit is contained in:
Joel Sherrill
2025-09-11 18:25:58 -05:00
committed by Gedare Bloom
parent 4beeafe1d7
commit 76d37a714e

View File

@@ -80,9 +80,7 @@
*
* If the variant only supports thumb insturctions disable the support.
*/
#define NEEDS_THUMB_SWITCH !ARM_THUMB_ONLY && defined(__thumb__)
#if NEEDS_THUMB_SWITCH
#if !ARM_THUMB_ONLY && defined(__thumb__)
#define ARM_SWITCH_REG uint32_t arm_switch_reg
#define ARM_SWITCH_REG_ASM [arm_switch_reg] "=&r" (arm_switch_reg)
#define ARM_SWITCH_REG_ASM_L ARM_SWITCH_REG_ASM,