Skip to main content



      Home
Home » Archived » DSDP - Mobile Tools for Java (MTJ) » Boolean clauses in preprocessor directives
Boolean clauses in preprocessor directives [message #481281] Thu, 20 August 2009 06:49 Go to next message
Eclipse UserFriend
I am trying to use the preprocessor like the C preprocessor, but I fail.

I've read that boolean clauses ( && and || ) can be used, but this does not work:

//#ifdef DEFINED_VALUE && (DEFINED_VALUE == 2)
//#else
//#endif



How can I make it work?

Thank you.

[Updated on: Thu, 20 August 2009 07:03] by Moderator

Re: Boolean clauses in preprocessor directives [message #481286 is a reply to message #481281] Thu, 20 August 2009 07:05 Go to previous messageGo to next message
Eclipse UserFriend
I think i found a workaround.

//#if (DEFINED_VALUE) && (DEFINED_VALUE == 2)
//#else
//#endif



The code above seems to work. Is that the correct way of doing it?
Re: Boolean clauses in preprocessor directive s [message #481293 is a reply to message #481286] Thu, 20 August 2009 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

You can check this on our documentation
http://help.eclipse.org/galileo/topic/org.eclipse.mtj.doc.us er/html/tasks/preprocessProject.html
about preprocessing or you can use the one on the Antenna Preprocessor
page: http://antenna.sourceforge.net/wtkpreprocess.php

Cheers
Diego
Re: Boolean clauses in preprocessor directive s [message #481301 is a reply to message #481293] Thu, 20 August 2009 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Yes, I've already read the documentation, and not only it seems that #ifdef, #ifndef does not accept added complexity, but moreover one cannot define a variable to have a value.

Why cannot I have
#define VALUE "true"


when I can do it throught the project properties?


About the ant preprocessor... I don't know if it can be used "silently" like MTJ does. If it is possible, then I'll take a look.


Thanks for you answer.
Re: Boolean clauses in preprocessor directives [message #481313 is a reply to message #481301] Thu, 20 August 2009 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

MTJ uses antenna preprocessor behind the scenes. So, every thing that goes
with antenna preprocessor backend v3 should be supported by MTJ.

About )#define VALUE "true") if I'm not mistaken, the correct syntax is

#define VALUE=true

Cheers,
Diego
Re: Boolean clauses in preprocessor directives [message #481362 is a reply to message #481313] Thu, 20 August 2009 11:58 Go to previous messageGo to next message
Eclipse UserFriend
Yes Diego, you're right about the #define issue. I got that solution before reading your message but forgot to post it here.

Thanks for the response anyway, and thanks for the information about the ant task.
Re: Boolean clauses in preprocessor directive s [message #576061 is a reply to message #481286] Thu, 20 August 2009 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

You can check this on our documentation
http://help.eclipse.org/galileo/topic/org.eclipse.mtj.doc.us er/html/tasks/preprocessProject.html
about preprocessing or you can use the one on the Antenna Preprocessor
page: http://antenna.sourceforge.net/wtkpreprocess.php

Cheers
Diego
Re: Boolean clauses in preprocessor directive s [message #576088 is a reply to message #481293] Thu, 20 August 2009 08:42 Go to previous messageGo to next message
Eclipse UserFriend
Yes, I've already read the documentation, and not only it seems that #ifdef, #ifndef does not accept added complexity, but moreover one cannot define a variable to have a value.

Why cannot I have

#define VALUE "true"

when I can do it throught the project properties?


About the ant preprocessor... I don't know if it can be used "silently" like MTJ does. If it is possible, then I'll take a look.


Thanks for you answer.
Re: Boolean clauses in preprocessor directives [message #576108 is a reply to message #576088] Thu, 20 August 2009 09:11 Go to previous messageGo to next message
Eclipse UserFriend
Hi David,

MTJ uses antenna preprocessor behind the scenes. So, every thing that goes
with antenna preprocessor backend v3 should be supported by MTJ.

About )#define VALUE "true") if I'm not mistaken, the correct syntax is

#define VALUE=true

Cheers,
Diego
Re: Boolean clauses in preprocessor directives [message #576130 is a reply to message #481313] Thu, 20 August 2009 11:58 Go to previous message
Eclipse UserFriend
Yes Diego, you're right about the #define issue. I got that solution before reading your message but forgot to post it here.

Thanks for the response anyway, and thanks for the information about the ant task.
Previous Topic:Boolean clauses in preprocessor directives
Next Topic:Bug in MTJ preprocessor documentation
Goto Forum:
  


Current Time: Sat Mar 15 21:07:43 EDT 2025

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

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

Back to the top