Obviously gcc -DMACRO=Something won't work when it is already defined in the
source file.
I'm trying to avoid patching the source file tree every time a new version is
issued. Unfortunately the #define moves around between files with different
versions. So I'd have to search for the file with the #define before
patching it and that's a little ugly.
Any ideas?
--
Steve
Not without touching the source.
> I'm trying to avoid patching the source file tree every time a new version is
> issued. Unfortunately the #define moves around between files with different
> versions. So I'd have to search for the file with the #define before
> patching it and that's a little ugly.
The #define in the source should be wrapped into something like
#ifndef FOO
#define FOO 2.1
#endif
Then you can use -DFOO=2.3 to "override" it.
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
>Steve <nos...@nospam.demon.co.uk> wrote:
>> Is it possible to override a #define in a source file with a gcc macro?
>
>Not without touching the source.
>
>> I'm trying to avoid patching the source file tree every time a new version is
>> issued. Unfortunately the #define moves around between files with different
>> versions. So I'd have to search for the file with the #define before
>> patching it and that's a little ugly.
>
>The #define in the source should be wrapped into something like
>
>#ifndef FOO
>#define FOO 2.1
>#endif
>
>Then you can use -DFOO=2.3 to "override" it.
>
>Andre'
OK - shame. I don't have control of the source, so a bash script it is.
--
Steve