Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Mobile Tools for Java (MTJ) » Defines in files included by preprocessor are not honoured
icon4.gif  Defines in files included by preprocessor are not honoured [message #481463] Fri, 21 August 2009 07:44 Go to next message
David Lucena is currently offline 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 #481544 is a reply to message #481463] Fri, 21 August 2009 13:36 Go to previous messageGo to next message
Euclides Neto is currently offline Euclides Neto
Messages: 8
Registered: July 2009
Junior Member
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
Re: Defines in files included by preprocessor a re not honoured [message #481577 is a reply to message #481544] Fri, 21 August 2009 15:54 Go to previous messageGo to next message
David Lucena is currently offline 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.


Re: Defines in files included by preprocess or a re not honoured [message #481610 is a reply to message #481577] Fri, 21 August 2009 20:01 Go to previous messageGo to next message
Euclides Neto is currently offline Euclides Neto
Messages: 8
Registered: July 2009
Junior Member
Hello David,

MTJ uses a third party library (antenna) to provide the preprocessing
feature. I've found an opened bug on antenna's bug tracker that seems to
be the root cause of this issue. Please, verify if the same problem is
described here:
http://sourceforge.net/tracker/index.php?func=detail&aid =1766666&group_id=67420&atid=517826

Thanks,
-- Euclides
Re: Defines in files included by preprocess or a re not honoured [message #481645 is a reply to message #481610] Sat, 22 August 2009 08:22 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Yes, is the same.

This means that until the bug is not resolved in antenna it will not resolved in MTJ?

I really think that is very useful that this bug is solved, or if it is not really a bug, but a design issue, it is changed.

Thanks for the information.
Re: Defines in files included by preprocess or a re not honoured [message #481787 is a reply to message #481645] Mon, 24 August 2009 10:32 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Just a question. Nobody since the ability of using the preprocessor was implemented, has needed this feature?

I think I could not live without... Althout at the moment I think I will have to...
Re: Defines in files included by preprocess or a re not honoured [message #481796 is a reply to message #481645] Mon, 24 August 2009 11:13 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Since we require the antenna preprocessor, the bug you found wont be
resolved until it's fixed on antenna. Someone could send a patch to them
with a fix, but we would need to wait until they release to initiate
eclipse legal process to be able to use it, an then we could release a new
mtj version with this fix.
Re: Defines in files included by preprocess or a re not honoured [message #481797 is a reply to message #481787] Mon, 24 August 2009 11:14 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
No, you were the first to report it to us.
Re: Defines in files included by preprocess or a re not honoured [message #481805 is a reply to message #481796] Mon, 24 August 2009 11:49 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
About that patch. If there were someone that could submit it, there would be the need to download the anntena sources, apply the patch, build the libraries and substitute them in eclipse. Is thas the process?

If so maybe I could try to found if someone did a patch o proposed one...
Re: Defines in files included by preprocess or a re not honoured [message #481814 is a reply to message #481805] Mon, 24 August 2009 12:11 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
By the way, has someone tried lately to acces antena repositories?

I have tried to get the sources but the server seems to be down. And the sourceforge page of the project seems not to have much activity. Anyone knows if this project is still alive?
Re: Defines in files included by preprocess or a re not honoured [message #481817 is a reply to message #481805] Mon, 24 August 2009 12:34 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Nops. We would need them to release a new version of antenna preprocessor an then we need to request to Eclipse IP team to use the newer version. If the request is approved, we integrate the library in the antenna.preprocessor.v3 and release it on a nightly build.

Re: Defines in files included by preprocess or a re not honoured [message #481821 is a reply to message #481814] Mon, 24 August 2009 12:39 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
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.
Re: Defines in files included by preprocess or a re not honoured [message #481824 is a reply to message #481821] Mon, 24 August 2009 12:54 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Well, If you Diego or someone manage to get the code, I would appreciate the new url server or something. I will try to look at the code to see if I could find a way to solve the issue, although with the current project I have at job I am not sure having enough time. But if I can it would help alot.
Re: Defines in files included by preprocess or a re not honoured [message #481844 is a reply to message #481824] Mon, 24 August 2009 14:26 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Well, I used this connection and could checkout the code;
:pserver:anonymous@antenna.cvs.sourceforge.net:/cvsroot/antenna

from https://sourceforge.net/projects/antenna/develop

Maybe the server was down when you tried.
Re: Defines in files included by preprocess or a re not honoured [message #482004 is a reply to message #481844] Tue, 25 August 2009 05:51 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Yes, that was just the address I followed, but by some reason I cannot connect due to timeout. I've tried again and nothing. Anyway, yesterday I was pointed to download https://sourceforge.net/projects/antenna/files/Preprocessor% 20library/1.2/preprocessor-v3-src-1.2.zip/download by Omry itself, so I'll see if I can do something.

And as I see it uses the Netbeans layout, although I know I can import the xml from eclipse, I'll install netbeans in order to follow the same build system as the original source.

May the force be with me...
Re: Defines in files included by preprocessor are not honoured [message #483171 is a reply to message #481463] Mon, 31 August 2009 13:15 Go to previous messageGo to next message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Hi Diego, after adding suport for //#preprocess to the antenna preprocessor in order to make MTJ compatible with Blackberry tools, I have also solved the //#include issue, by merging the definitions from the included file into the current definitions.

If you need the code I would be please to zip it and send it to you. I don't know how to extract a patch file, nor I don't know if I have the tools for this, so I think it's better for you to do so.

It would be nice that this feature could be tested and included asap in a MTJ release.


Thank you.
Re: Defines in files included by preprocessor are not honoured [message #483256 is a reply to message #483171] Mon, 31 August 2009 18:42 Go to previous messageGo to next message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Hi David,

thanks for your effort, but i cant apply your modification into mtj. First you must submit it to antenna team to be integrate. I'd suggest you to send this directly to Omry and he can arrange a new release of the antenna preprocessor.

After he release an public version on the antenna website, I'll open an request to the Eclipse IP team to include this newer version on mtj.

Re: Defines in files included by preprocessor are not honoured [message #483359 is a reply to message #483256] Tue, 01 September 2009 10:45 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
I have submitted some patches to Omry, but as he is not in the project anymore I also have asked him to put me in contact with the current administrator/mantainer/updater so I will not bother him anymore.

I'll tell you more when I know.
Re: Defines in files included by preprocessor a re not honoured [message #576231 is a reply to message #481544] Fri, 21 August 2009 15:54 Go to previous message
David Lucena is currently offline 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.
Re: Defines in files included by preprocess or a re not honoured [message #576266 is a reply to message #481577] Fri, 21 August 2009 20:01 Go to previous message
Euclides Neto is currently offline Euclides Neto
Messages: 8
Registered: July 2009
Junior Member
Hello David,

MTJ uses a third party library (antenna) to provide the preprocessing
feature. I've found an opened bug on antenna's bug tracker that seems to
be the root cause of this issue. Please, verify if the same problem is
described here:
http://sourceforge.net/tracker/index.php?func=detail&aid =1766666&group_id=67420&atid=517826

Thanks,
-- Euclides
Re: Defines in files included by preprocess or a re not honoured [message #576287 is a reply to message #481610] Sat, 22 August 2009 08:22 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Yes, is the same.

This means that until the bug is not resolved in antenna it will not resolved in MTJ?

I really think that is very useful that this bug is solved, or if it is not really a bug, but a design issue, it is changed.

Thanks for the information.
Re: Defines in files included by preprocess or a re not honoured [message #576298 is a reply to message #481645] Mon, 24 August 2009 10:32 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Just a question. Nobody since the ability of using the preprocessor was implemented, has needed this feature?

I think I could not live without... Althout at the moment I think I will have to...
Re: Defines in files included by preprocess or a re not honoured [message #576338 is a reply to message #481645] Mon, 24 August 2009 11:13 Go to previous message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Since we require the antenna preprocessor, the bug you found wont be
resolved until it's fixed on antenna. Someone could send a patch to them
with a fix, but we would need to wait until they release to initiate
eclipse legal process to be able to use it, an then we could release a new
mtj version with this fix.
Re: Defines in files included by preprocess or a re not honoured [message #576356 is a reply to message #576298] Mon, 24 August 2009 11:14 Go to previous message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
No, you were the first to report it to us.
Re: Defines in files included by preprocess or a re not honoured [message #576367 is a reply to message #481796] Mon, 24 August 2009 11:49 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
About that patch. If there were someone that could submit it, there would be the need to download the anntena sources, apply the patch, build the libraries and substitute them in eclipse. Is thas the process?

If so maybe I could try to found if someone did a patch o proposed one...
Re: Defines in files included by preprocess or a re not honoured [message #576377 is a reply to message #576367] Mon, 24 August 2009 12:11 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
By the way, has someone tried lately to acces antena repositories?

I have tried to get the sources but the server seems to be down. And the sourceforge page of the project seems not to have much activity. Anyone knows if this project is still alive?
Re: Defines in files included by preprocess or a re not honoured [message #576381 is a reply to message #576367] Mon, 24 August 2009 12:34 Go to previous message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Nops. We would need them to release a new version of antenna preprocessor an then we need to request to Eclipse IP team to use the newer version. If the request is approved, we integrate the library in the antenna.preprocessor.v3 and release it on a nightly build.
Re: Defines in files included by preprocess or a re not honoured [message #576394 is a reply to message #481814] Mon, 24 August 2009 12:39 Go to previous message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
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.
Re: Defines in files included by preprocess or a re not honoured [message #576420 is a reply to message #481821] Mon, 24 August 2009 12:54 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Well, If you Diego or someone manage to get the code, I would appreciate the new url server or something. I will try to look at the code to see if I could find a way to solve the issue, although with the current project I have at job I am not sure having enough time. But if I can it would help alot.
Re: Defines in files included by preprocess or a re not honoured [message #576441 is a reply to message #576420] Mon, 24 August 2009 14:26 Go to previous message
Diego Madruga Sandin is currently offline Diego Madruga Sandin
Messages: 116
Registered: July 2009
Senior Member
Well, I used this connection and could checkout the code;
:pserver:mailto:anonymous@antenna.cvs.sourceforge.net:/cvsroot/antenna

from https://sourceforge.net/projects/antenna/develop

Maybe the server was down when you tried.
Re: Defines in files included by preprocess or a re not honoured [message #576456 is a reply to message #576441] Tue, 25 August 2009 05:51 Go to previous message
David Lucena is currently offline David Lucena
Messages: 74
Registered: August 2009
Member
Yes, that was just the address I followed, but by some reason I cannot connect due to timeout. I've tried again and nothing. Anyway, yesterday I was pointed to download https://sourceforge.net/projects/antenna/files/Preprocessor% 20library/1.2/preprocessor-v3-src-1.2.zip/download by Omry itself, so I'll see if I can do something.

And as I see it uses the Netbeans layout, although I know I can import the xml from eclipse, I'll install netbeans in order to follow the same build system as the original source.

May the force be with me...
Previous Topic:Errors during source build
Next Topic:Defines in files included by preprocessor are not honoured
Goto Forum:
  


Current Time: Thu Oct 23 14:34:21 GMT 2014

Powered by FUDForum. Page generated in 0.04493 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software