So, the requested functionality could be added by a compiler-global settings as dumb string replace on the tokenizer level and even before it (preprocessor).
Could-could-could... the point is that it /doesn't/ and isn't going to.
Definitions, i.e. the parameter of an $ifdef, are project-level so are conveniently global. I don't believe that macros are (I might check later, but not immediately; please feel free to preempt me).
However that /still/ doesn't help OP, unless the original author of the unit he's inheriting from changes his code... and if he does there's plenty of ways better than relying on a preprocessor.
I have my own opinion on this, which I have vented plenty of times already. The bottom line is that by now FPC- even discounting the RTL etc.- is a massively complex undertaking, and we're stuck with what the core team is (rather thanklessly) maintaining and enhancing.
Later: unless my experiment misses something obvious, a macro has to be defined in the file where it's being used i.e. can't be defined at the project level.
Assuming Lazarus, a project-level option like
-dmacro_test:=''
is passed to the compiler on the command line without the quoted part but is not picked up by e.g.
initialization
WriteLn( macro_test );
...
However either of these forms works in a unit file:
{ define macro_test:='' }
{$define macro_test:= }
So it's the := in the definition that's significant, rather than the quoted parameter. And even if this /could/ be fixed the likelihood that it /will/ be fixed is vanishingly small.
MarkMLl