Defines in files included by preprocessor are not honoured [message #481463] |
Fri, 21 August 2009 03:44  |
Eclipse User |
|
|
|
Hi. I have a somewhat important problem.
I have a set of defines that depend of the definition of other defines. The latter can be defined in the project, while the former can only be defined in the files. As they are needed in too many files of the project, I decided to create a file and write them there, and then just include that file for every project file that need those defines,
But the defines that are in the included file are not honoured,
Is this a bug of current MJT preprocessor, or it is designed this way? Can somebody give me a workaround if it is just a bug?
Thank you very much in advance, I really would appreciate a solution, because as the project advances, the need of defines is bigger and I don't want to have to write them all in every file, as it could be really messy.
Thanks again.
David Lucena.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Defines in files included by preprocessor a re not honoured [message #576231 is a reply to message #481544] |
Fri, 21 August 2009 11:54  |
Eclipse User |
|
|
|
Euclides Neto wrote on Fri, 21 August 2009 09:36
> Hello David,
>
> In order to help us to better understand the problem, could you send us
> some examples of defines that depends on definition of other defines?
>
> Thanks,
> -- Euclides
Yes of course:
//#if (USE_IMAGEMANAGER) && ( USE_IMAGEMANAGER == 1 )
//#define DO_USE_IMAGEMANAGER
//#else
//#undefine DO_USE_IMAGEMANAGER
//#endif
//#if (DEBUG_IMAGE_MEMORY) && ( DEBUG_IMAGE_MEMORY == 1 )
//#define DO_DEBUG_IMAGE_MEMORY
//#else
//#undefine DO_DEBUG_IMAGE_MEMORY
//#endif
//#ifdef DO_DEBUG_IMAGE_MEMORY
//#ifndef DO_USE_IMAGEMANAGER
//#undefine DO_DEBUG_IMAGE_MEMORY
//#endif
//#endif
In the code above, USE_IMAGEMANAGER and DEBUG_IMAGE_MEMORY are defined in the project, but not DO_USE_IMAGEMANAGER and DO_DEBUG_IMAGE_MEMORY.
DO_USE_IMAGEMANAGER is defined for a short of /#if (USE_IMAGEMANAGER) && ( USE_IMAGEMANAGER == 1 )
The same with DO_DEBUG_IMAGE_MEMORY, but also depends of DO_USE_IMAGEMANAGER to be defined.
|
|
|
|
|
|
|
|
|
|
|
Re: Defines in files included by preprocess or a re not honoured [message #576394 is a reply to message #481814] |
Mon, 24 August 2009 08:39  |
Eclipse User |
|
|
|
Well, the last time i heard from Omry, if I'm not mistaken, he said that he would not continuing maintaining the code.
If someone provide a fix to this issue, we could try to get in touch with Omry and try to request this fix to be integrated in a new version of the preprocessor, but we don't have any guaranties that this would happen.
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08622 seconds