Defines in files included by preprocessor are not honoured [message #481463] |
Fri, 21 August 2009 03:44  |
David Lucena Messages: 74 Registered: August 2009 |
Member |
|
|
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  |
David Lucena Messages: 74 Registered: August 2009 |
Member |
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02781 seconds